It looks like you're new here. If you want to get involved, click one of these buttons!
Object = Core.class(Sprite) local tmp = 0 local function onEnterFrame() tmp = tmp + 1 print(tmp) end function Object:init() self:addEventListener(Event.ENTER_FRAME, onEnterFrame) end |
for i=1,4 do local object = Object.new() end |
0 0 0 0 1 1 1 1... |
0 1 2... |
Comments
http://www.nightspade.com
Object.lua:
Website: http://www.castlegateinteractive.com
https://play.google.com/store/apps/developer?id=Castlegate+Interactive
I like the fact that onEnterFrame() is not accessible from "outside" in Scouser's example.