A Flash Developer Resource Site

Results 1 to 4 of 4

Thread: Flash Game Help: Coins

  1. #1
    Junior Member
    Join Date
    Aug 2009
    Posts
    7

    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.

  2. #2
    Senior Member bluemagica's Avatar
    Join Date
    Jun 2008
    Posts
    766
    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:

  3. #3
    Pumpkin Carving 2008 ImprisonedPride's Avatar
    Join Date
    Apr 2006
    Location
    Grand Rapids MI
    Posts
    2,378
    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

  4. #4
    Junior Member
    Join Date
    Aug 2009
    Posts
    7
    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
  •  




Click Here to Expand Forum to Full Width

HTML5 Development Center