The new game I'm developing

Here’s the new game I’m developing:

http://www.youtube.com/watch?v=LwL-ijZkJ18&context=C3f1d825ADOEgsToPDskIgooidOObjoyhPt60vfyZd

I’m still new to Corona and Lua and could use a little help.
When the sprite reaches the end of the map/level I’d like it to have a pop up saying “Level 1 Cleared” or something. Also when the sprite falls off the bottom of the screen I’d like it to say “Game Over” and have a retry button spawn. Any help would be greatly appreciated and would get credit in the special thanks section.

Cheers,
Andrew [import]uid: 72845 topic_id: 20157 reply_id: 320157[/import]

Maybe there’s a better way, but the most obvious method is to use an event listener. It depends on how you are handling end of level, though. Like, for now let’s just assume end of level is past the right-side edge of the screen.

[code]
– The function
local doStuff = function(event)
– Check to see if you’ve passed the end of level
if spriteguy.x > display.contentWidth then
print(“You cleared Level 1”)
levelComplete()
elseif spriteguy.y > display.contentHeight then
print (“You died.”)
gameOver()
end
end --/doStuff

– If you don’t have an event listener…
Runtime:addEventListener( “enterFrame”, doStuff )[/code]

You’d then need to write seperate functions for the popups for levelComplete() and gameOver(). [import]uid: 41884 topic_id: 20157 reply_id: 78750[/import]