Multiple enemies running away from player?

Get help using Construct 2

Post » Wed Feb 05, 2014 2:19 am

Hi,

I have been looking into other topics and I found the way that make an enemy run away from the player. However, I'm trying to make multiple enemies to run away, so I can create multiple instances and all of them would be affected. I tried with Families, but I may have done something wrong...

Does anybody knows how to make multiples copies of each enemy to behave independently, so each enemy runs only when the player gets closer and not all of them running at the same time?

A sample capx can be found here in this link

This could be like the ghosts from Pacman, whenever pacman eats the white pill.

Any help would be great! Thanks!!!
B
8
S
3
G
1
Posts: 135
Reputation: 2,209

Post » Wed Feb 05, 2014 3:01 am

First problem was you had default controls on for the enemy 8-direction, so it was just doing whatever the arrow keys said. Second, you need a way to marry the EnemyBox to the Enemy for picking, not just positioning.

This is one way. 'Containers' are another:
runningaway_BHT.capx

(And keep your helper boxes visible, so you can see what's going on as you develop. If you turn them on in your current code, you'll see the two EnemyBoxes are actually pinned to only one Enemy.)blackhornet2014-02-05 03:03:44
ImageImageImage
B
71
S
21
G
221
Posts: 3,649
Reputation: 124,227

Post » Wed Feb 05, 2014 3:47 am

@blackhornet thank you so much, that is really simple... I still have too much to learn!!!! Thanks!!!! Whenever I finish this game, I will place you as Special Thanks! :)
B
8
S
3
G
1
Posts: 135
Reputation: 2,209


Return to How do I....?

Who is online

Users browsing this forum: No registered users and 8 guests