Lua does not have classes but it does have functions which can make up for it if used in the right way. To do pseudo classes in lua it's pretty simple, just try and create your classes like so.
CODE
Account = class(function(acc,balance)
acc.balance = balance
end)
function Account:withdraw(amount)
self.balance = self.balance - amount
end
-- can create an Account using call notation!
acc = Account(1000)
acc:withdraw(100)
acc.balance = balance
end)
function Account:withdraw(amount)
self.balance = self.balance - amount
end
-- can create an Account using call notation!
acc = Account(1000)
acc:withdraw(100)
You can find more about simple lua classes here, http://lua-users.org/wiki/SimpleLuaClasses . For more advanced classes please use your best internet buddy called GOOGLE!
Now let's get back to lua, Lua like every language will have a framework for creating games and I know 2 good ones and I'll recommend the one I use over the other one.
The 2 frameworks/engines that I know of are.
- Love 2D
- Agen
Love 2D is obviously a 2D game framework that will allow for rapid game development, now there is some setbacks if you're used to say RPG Maker or never called for external maps in Game Maker. There is no editor at all, it's just raw code with Love Commands and enhancements to lua. There is an IDE in the works but there is some good news as well, just because there's no IDE or editor doesn't mean it's hard to use. At first I thought it was a nightmare but after a couple hrs I had a pretty good platform engine using Box2D(you'll need to implement this yourself with Love)
Agen is also a 2D game framework that uses lua, so what makes it different than Love? well it comes with Box2D out of the box, it's easier to get started with(imo anyway) and it has some pretty nifty features.
If you're looking to do both 2D and 3D(leaving 2.5d out of the mix) than there is the Baja engine which is very powerful and uses lua 5.1.