Please note; I am eleven years old and a novice at Corona.
I created some simple but interesting code for having a raised floor, two buttons (for left and right movement) and a rock that can be rolled around. I plan to create a checkpoint that will allow you to start at a different place than where you first started. The problem is, even after falling the distance that should respawn it, it won’t respawn. Everything else works, but it won’t initiate the function, even if I add an event listener to the rock itself. Here’s the relevant code:
[code]
checkpointX = 240; checkpointY = 100
local function respawn (event)
if ( rock.y < 400 ) then
rock:setLinearVelocity( 0, 0 )
rock.x = checkpointX
rock.y = checkpointY
end
end
rock:addEventListener( “enterFrame”, respawn ) [import]uid: 82408 topic_id: 15219 reply_id: 315219[/import]