well, you have a nice set of problems here 
so let’s start with a little
local countTimer
local countSeconds = 10
local function countDown ()
countSeconds = countSeconds - 1
print ("Seconds: "..countSeconds)
if countSeconds == 0 then
timer.cancel(countTimer)
print ("Horaaay!")
end
end
countTimer = timer.performWithDelay(1000, countDown, 0)
health bar: http://howto.oz-apps.com/2011/06/make-bobbing-bar.html
------------------
-- HIT TEST Circle --
-----------------
-- example: hitTestCircle (obj1, obj2, [distance in pixels, default=30])
-- returns: true/false
-----------------
hitTestCircle = function (obj1, obj2, dist)
if obj1.x ~= nil and obj2.x ~= nil then -- do they even exist?
local dist = dist or 30
local sqrt = math.sqrt
local dx = obj1.x - obj2.x
local dy = obj1.y - obj2.y
local distance = math.sqrt(dx\*dx + dy\*dy) -- pythagoras FTW!
if distance \< dist then
return true
else
return false
end
else
return false
end
end
------------------
-- HIT TEST Square --
-----------------
-- example: hitTestSquare (obj1, obj2)
-- returns: true/false
-----------------
hitTestSquare = function( obj1, obj2 )
if obj1.x \> obj2.x + obj2.width/2 - 1 or
obj1.y \> obj2.y + obj2.height/2 - 1 or
obj2.x \> obj1.x + obj1.width/2 - 1 or
obj2.y \> obj1.y + obj1.height/2 - 1 then
return false
else
print ("HIT!")
return true
end
end
-- example:
obj1 = display.newCircle( 100, 100, 100 )
obj2 = display.newCircle( 150, 150, 100 )
if hitTestCircle (obj1, obj2, 100) then
print ("BOOM!")
end
as for the end of the game think of something like this
local gameOver = false
function gameLoop()
if gameOver == false then
-- move character and stuff like that
if heroHP == 0 then
gameOver = true
end
else
-- show game over screen
end
end
hope that helps 
-finefin [import]uid: 70635 topic_id: 30766 reply_id: 123195[/import]