Hello.
I’ve been searching the internet on how to delete images and I think I’ve found some good info. What I’m doing with my game is when the game is over a couple buttons appear with options like “next level,” “retry,” and “menu.” My problem is I want to get rid (or kind of hide them with out hogging memory) of the options, play the game, and have them reappear. I have some code of my own that i’ve been working on but I don’t know how to make the options reappear with out doubling the code on each of the buttons.
function touchHandler(e)
menuGroup = display.newGroup()
if(e.phase == "began") then
n = n - 5
elseif(e.phase == "ended") then
timer.performWithDelay(2000, spawnApple)
score = 0
scoreText.text = score
score = score + 1
--the delete function
display.remove( btn )
self = nil
end
end
btn:addEventListener("touch", touchHandler)
And I’m currently just doubling this code in the function will make the options appear. But again I don’t have good code to make the options reappear.
Thank you! [import]uid: 59140 topic_id: 14026 reply_id: 314026[/import]
