New to LUA

Hi, I am new to Lua. I have moved from doing applications like Markdown editors using Python. I am now moving on to see what it is like programming in Lua on an iPad. I want to make a game that is an RPG type game. You can loot items, store them in your inventory, travel to different maps, and even fight enemies. I want to make different maps, and I am assuming you’d want to make classes for that. But I am not sure exactly what classes are in this application. Are they just like in Python? A way to organize variables and functions into one area?

Thanks for you help.


Welcome! First you need to read up on Lua, especially its classes and tables. I’ve written some ebooks and a lot of posts, here, including games like RPG, 3D, etc

I recommend reading the Lua book, then Codea.

PS Codea is the most fun I’ve ever had programming.

I forgot to add that Codea is great for building the game you described.

I was messing around, and I noticed that the syntax is very simple and similar to Python. I understand classes, just took me a while to understand what was happening.

@Ignatz however, I do have one more question… how do I recognize if a sprite has been tapped on? I was thinking about using the CurrentTouch.x and CurrentTouch.y and making it check if the location you tapped is within a predefined location made in the code by doing something like “if CurrentTouch.x >= 50 and CurrentTouch.y >= 50 then…” assuming the sprite’s 50 by 50. But you’d think there’d be an easier way.

CurrentTouch works, but it’s better to learn how to use the function touched().

Use touched() - see here


@TokOut lol, you’d be surprised at how far I’ve gotten in one week. Programming isn’t very hard for me to learn. It takes me a few answered questions on the forums, and the rest I get by myself. And vualah! My game is created.