comparable distance

Get help using Construct 2

Post » Wed Mar 27, 2013 2:29 pm

I want an enemy to stay within a certain range from its initial starting point (say x=200,y=200) and its stays within 50pixels from this point how would I do this?

I've tried the distance comparable but don't really understand how it works, any help would be appreciated

thanks in advanceLI0NHART2013-03-27 14:30:10
B
14
S
4
G
3
Posts: 77
Reputation: 4,011

Post » Wed Mar 27, 2013 2:50 pm

you can use some sprites as guides for your enemies, if they collide with them they will change their direction.
B
17
S
2
G
2
Posts: 82
Reputation: 1,712

Post » Wed Mar 27, 2013 3:24 pm

You arent really giving enough info. What behavior are your enemies using? Also, distance() will return the amount of pixels between object1 and object2 so you're on the right track.
B
40
S
12
G
7
Posts: 603
Reputation: 7,646

Post » Thu Mar 28, 2013 1:14 pm

Enemies are place in the layout and its X and Y position are stored in instance variables on start of layout

they move via 8 Direction object

if the enemies X co or Y co are (lets say) more than 50 pixels away from their instance variable counterpart then the enemie would return to the instance variables location

This should be an easy thing to do but i can't figure how to do it
LI0NHART2013-03-28 13:14:16
B
14
S
4
G
3
Posts: 77
Reputation: 4,011


Return to How do I....?

Who is online

Users browsing this forum: Megavolt, mnashwan, Yahoo [Bot] and 22 guests