• Advertisement
Sign in to follow this  

Gold Coin Deletion Code Problem

This topic is 3549 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

hi. Im new to games design in flash and have come across a problem that i was hoping someone could help with. My problem is this... I have tried to make a simple game where you control the player and have to collect gold coins. But after you have collected the first coin. The next ones dont seem to want to delete and it doesnt add a point to the players score. the actionscript i have got on the gold coins is this... onClipEvent(EnterFrame) { if (_root.gold2.hitTest(_root.man)) { _root.plscore = +1; _root.gold2.removeMovieClip(); } } I am not sure, however, if i should have the hittest code on the coin or on the player or anything. Im so confused as to why it isnt working. can someone please help?

Share this post


Link to post
Share on other sites
Advertisement
I just looked at some docs on removeMovieClip(). It looks like it only works for dynamically created moveclips (ones that were created using AS). So if your level is already layed out on the stage with coins and all, I don't think it will work.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement