-
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.
-
Senior Member
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!
If you like me, add me to your friends list  .
PS: looking for spriters and graphics artists for a RPG and an Arcade fighting project. If you can help out, please pm me!
My Arcade My Blog
Add me on twitter: 
-
Pumpkin Carving 2008
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.
The 'Boose':
ASUS Sabertooth P67 TUF
Intel Core i7-2600K Quad-Core Sandy Bridge 3.4GHz Overclocked to 4.2GHz
8GB G.Skill Ripjaws 1600 DDR3
ASUS ENGTX550 TI DC/DI/1GD5 GeForce GTX 550 Ti (Fermi) 1GB 1GDDR5 (Overclocked to 1.1GHz)
New addition: OCZ Vertex 240GB SATA III SSD
WEI Score: 7.6
-
Thank you both for the help!
Tags for this Thread
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|