Game over when ball falls off platform?

[blockcode]
flag = 0

if bigball has collision with platform then
flag = 1
end

if bigball leaves platform then
flag = 2
end

if flag = 2 then
gameOver()
end
[/blockcode]

The above idea would be ideal but I’m not too sure how I would go about this with Lua, (like which checks I would need to run every frame). Any advice?

Thanks in advance! [import]uid: 42777 topic_id: 7731 reply_id: 307731[/import]

Just use an event listener to check the y coords for the ball become greater than the platform.

local ball = display.newImage(“ball.png”)
local platform = display.newImage(“platform.png”)

local checkBall = function(event)
ball.y > then platform.y then
gameover()
end

Runtime:addEventListener(“enterFrame”, checkBall) [import]uid: 11809 topic_id: 7731 reply_id: 27439[/import]

Thanks! Sorted. [import]uid: 42777 topic_id: 7731 reply_id: 27465[/import]