Sign in to follow this  
Moro29

Gold Coin Deletion Code Problem

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
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

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this