-
Flash Game Help: Coins
Sorry if this has been asked before, I tried searching a few times but couldn't seem to pull up anything useful.
Anyways, here goes.
I am making a platformer. Every level of said platformer is a frame, and most levels have coins that the player collects. The player is able to go back and forth between the levels.
My question is, how can I make it so that once a coin is collected, it wont reappear if/when the player goes back to that level?
Any form of help is appreciated.
-
Umm, I don't know how to do this when the coins are placed by hand, cause then there's no way to directly reference them! If the coins are placed from code, you can create a global variable array, to keep track of which coins to keep!
-
That's about the ONLY way to do it. Keep a global two-dimensional array. First index is the level number, second index would be the array you push the name of a coin to. When you move to a "new" level, move any coin listed off the screen or delete it.
-
Thank you both for the help!