Hi everybody. I'm pretty much brand new to Construct 2 and am working my way through a platformer. I've run up against a snag with some of my enemy behavior. My enemies patrol over a set distance, turning when they collide with an invisible "detector sprite." No problems there.
When they're on collision with the player, I want them to go into an attack mode were a few things happen:
1) The enemy stops moving forward.
2) The enemy's animation changes to an attack animation.
3) The player's acceleration and jump strength is reduced, slowing him down.
4) For every 1.5 seconds that the player remains "under attack," his health is reduced.
5) Once the player gets away, everything goes back to normal.
This is what I've been able to work out so far:
Undoubtedly, there's a more elegant and efficient way to do this, so I am gladly open to any and all suggestions, but the big problem is that this works just fine, but only with the oldest instance of the enemy in the layout. On collision with any other enemy, there is absolutely no effect. If the oldest enemy instance is destroyed, then the attack actions work with the next instance, and so on.
I've looked through the manual and the forums and tutorials and can't, for the life of me, figure out what I'm doing wrong and why the attack actions only trigger for one enemy in the layout at a time.
Any help would be MUCH appreciated!