How do I make enemies animate separately?

Get help using Construct 2

Post » Sat Jun 13, 2015 7:40 am

Fairly simple question but something that has stumped me regardless. Here's the situation:

The sprites for the test enemies I recently placed in my game are tied to an object called "hitbox_test_enemy", and at the start of each layout they are spawned like so:

Image

Doing this creates a "sprite_test_enemy" at the position of each hitbox and sets that sprite to the position of the hitbox that spawned it. However, I don't know how to make the different "sprite_test_enemy"s animate independently. Whenever one animation is set to play on one, it affects all of them. How do I make it so that my "set animation" events (such as when the enemy is hit, dies etc.) only affects the relevant one and not all of them?
B
18
S
9
Posts: 103
Reputation: 1,817

Post » Sat Jun 13, 2015 8:10 am

Never mind, I figured it out. I placed the sprite object in a container for the hitbox object and changed my code to look like the following:

Image

Then I did this:

Image

Instead of just having them outside of the "for each" event, which was what I had before... and now they animate separately! I know the standing/airborne variables seem a bit redundant, but they're used independently outside of these two events for the enemy so they're both necessary there.
B
18
S
9
Posts: 103
Reputation: 1,817


Return to How do I....?

Who is online

Users browsing this forum: No registered users and 1 guest