I know in lua you can fake OOP by doing
--regular way
--This is what I am used too.
local player ={}
--Do your methods here
return Player
--Gideros:
Player = Core.class(Sprite)
function Player:init()
--Some vars
end
--Create some methods
Is making the class in Gideros way will make the app more optimized?
Thanks again in advance
www.zoolax.com
Comments
However, with this inheritance is not so easy. You could do
But in the Lua manual chapter on OO, it recommends a different way using metatables and I think that's what Gideros is using. I've never really understood what metatables do and not sure why this is better than the way just described...?
https://github.com/gideros/gideros
https://www.youtube.com/c/JohnBlackburn1975
Thanks john:)
Caution, beginners (like me)! - Please read OZApps' comment below.
Meet Kate. Grey is her favourite colour. Maths is her favourite subject. Decency is her favourite type of behaviour.
She definitely does not like jewellery or modelling, but loves aeroplanes and other machines made of aluminium.
Likes: Platypus
Author of Learn Lua for iOS Game Development from Apress ( http://www.apress.com/9781430246626 )
Cool Vizify Profile at https://www.vizify.com/oz-apps
Thanks, @OZApps.
Meet Kate. Grey is her favourite colour. Maths is her favourite subject. Decency is her favourite type of behaviour.
She definitely does not like jewellery or modelling, but loves aeroplanes and other machines made of aluminium.