android - Corona SDK animation not working with the director class? -


hey there trying use animations in game reason error here code used animation

local function animate( event )     gear.rotation = gear.rotation + 10 end runtime:addeventlistener("enterframe", animate); 

this works if use without director class director class change scene scene

i error message when try leave class or when go other class rotates until try leave class

the error = attempt perform arithmetic on field 'rotation' (a nil value)

any please in advance!

try this:

gear.rotation = 0  local function animate( event )     gear.rotation = gear.rotation + 10 end  runtime:addeventlistener("enterframe", animate); 

Comments

Popular posts from this blog

linux - xterm copying to CLIPBOARD using copy-selection causes automatic updating of CLIPBOARD upon mouse selection -

qt - Errors in generated MOC files for QT5 from cmake -