The Armor Games website will be down for maintenance on Monday 10/7/2024
starting at 10:00 AM Pacific time. We apologize for the inconvenience.

ForumsProgramming ForumDeleting instances

3 4122
maffegozer
offline
maffegozer
64 posts
Nomad

Hello,

I'm creating a game, and it contains collecting coins.
How do I delete coins when collected.
(Yes, with a hitTest, but what command do I put in it)

As a temporary solution I used _x / _y to move it out of the area...

  • 3 Replies
Xinito
offline
Xinito
109 posts
Nomad

I got a script on my laptop that will help you out, i'll get it tomorrow.

Carlytoon
offline
Carlytoon
324 posts
Nomad

well, in as3 theres a removeChild function to delete instances.

WhiskeyedJack
offline
WhiskeyedJack
80 posts
Shepherd

And if you are working with AS2 you could have this.removeMovieClip() inside your coin's script which can be triggered after the hit test. Otherwise you need some manner of identifying the instance of the coin (like an array) and you could use removeMovieClip(instance).

Showing 1-3 of 3