How do I get enemies to run away from the player?

Get help using Construct 2

Post » Sat Jul 27, 2013 1:23 pm

1st game with students input and it's going great; the game basically works on a "pac man" level. So now, I need to know how to get the ghosts to run away after our pack man eats the big pellet... any sugesstions, links, or videos?

What I last tried...
I thought converting the player in to an "obstacle" would do it, but it doesn't seem to work. Well, at least with a varible method.
B
15
S
5
G
2
Posts: 164
Reputation: 3,082

Post » Sat Jul 27, 2013 1:27 pm

Compare X and/or Y, or compare distance() between two objects.

If you use the distance formula, you might also have to do a for each loop because it won't register which enemy you want to run away otherwise.
B
10
S
3
G
3
Posts: 234
Reputation: 3,467

Post » Sat Jul 27, 2013 3:44 pm

@BurningWood

Depends how you are controlling the ghosts in the first place.

Why not attach a larger, invisible sprite to the player. When the ghosts come into contact just reverse their direction of travel.

B
47
S
16
G
9
Posts: 1,097
Reputation: 11,180


Return to How do I....?

Who is online

Users browsing this forum: No registered users and 11 guests