i need help with displaying lives with images, can anyone help me out and tell me what i’ve done wrong? thanks
so i have this in the beginning
lives = 3
this is the image i want to be displayed 3 times and make 1 heart be removed when lives are lost
local heart = display.newImage( “heart1.png” )
localGroup:insert(heart)
heart.x = 20
heart.y = 16
lives < 3 remove:Self()
this is the bug code thats supposed to subtract a life once touched, i put lives = lives -1 (this is probably wrong though)
local bug = display.newImage( “scorpion.png” )
localGroup:insert(bug)
bug.x = 600
bug.y = 0
local function moveit (event)
transition.to(bug, {time=7000, x=500, y=100})
local function moveback (event)
transition.to(bug, {time=2000, x=-100, y=300})
end
timer.performWithDelay (5000, moveback, 1)
end
timer.performWithDelay(5000, moveit, 0)
local function killbug (event)
local bloodscreen = display.newImage (“bloodscreen.png”)
transition.to( bloodscreen, { time=500, delay=300, alpha=0 } )
lives = lives - 1
blood.x = bug.x
blood.y = bug.y
bug:removeSelf()
end
bug:addEventListener(“touch”, killbug) [import]uid: 10827 topic_id: 4771 reply_id: 304771[/import]