Multiple enemies moving independently

Get help using Construct 2

Post » Tue Aug 20, 2013 12:38 am

Despite there already being some threads about this, I still can't seem to get this to work for me:

I'm making a platformer and have just built my first enemy. The AI and everything else works as it should.
Next I copied and pasted the enemy somewhere else in the layout so I could have two enemies of the same kind that would attack the player simultaneously.
Not being an absolute beginner, I also added "for each" conditions wherever I thought they might be necessary.
But as it turns out, this is not at all as easy as I though it would be. I've spent the last three days trying to get the AI to work for two enemies at once, with no luck.

So as a last resort I've decided to post an example.capx here and hope for someone to help me out.
Example.capx
So please, please, would someone be so kind?
This game is going to be part of my final project for art school so I can't just leave it unfinished.wiimote2013-08-20 00:50:26
B
19
S
5
Posts: 24
Reputation: 2,800

Post » Tue Aug 20, 2013 3:11 am

Two things. 1) you do need a 'For each' to check each enemy individually for the correct state. 2) you need to make sure you can pick the associated object that is pinned. You need to store the UID of the box for the dude, and the UID of the dude for the box so that they can be picked together.
example_BHT.capx
ImageImageImage
B
71
S
22
G
259
Posts: 3,794
Reputation: 143,704

Post » Tue Aug 20, 2013 5:35 am

What? ... Already? Wow. I wasn't sure if I'd get any replies at all.
It's perfect. I can't thank you enough.
How did you do this so fast? To me it looked unsolvable. A dead end.

You've added so few lines. Makes it look so easy. Yet I still don't fully understand why it works this way... I'll spend tomorrow working that out on my own.
Thanks.
B
19
S
5
Posts: 24
Reputation: 2,800


Return to How do I....?

Who is online

Users browsing this forum: No registered users and 28 guests