Hi,
i’m building a game that has three scenes ; Welcome, Menu, and the game screen
there’s an object ‘a stone’ that is supposed to be used 3 times to hit something … and after every hit i use the ’ removeSelf() ’ function to remove this stone and then generate the next one by calling this function with a nextStone button … :
local function resetStone()
stone_eg = display.newImage(“Objects/eagle_stone.png”)
localGroup:insert(stone_eg)
stone_eg.x=eagle.x-5
stone_eg.y=eagle.y+35
physics.addBody(stone_eg,“kinematic”, {density=10.0, friction=0.1, bounce=0, radius=10})
stone_eg.type=“stone”
end
…
after throwing it three times … a ‘game over’ button is shown up … and this button action is to go back to the Menu screen
the problem is when i press play again to play one more time … after the first stone hit, an error occurred
ERROR: Attempt to remove an object that’s already been removed from the stage or whose parent/ancestor group has already been removed.
in this line: stone:removeSelf()
any thoughts !!??
[import]uid: 96659 topic_id: 17993 reply_id: 317993[/import]