|
Post by TheRPGNOOb on Aug 28, 2004 19:44:28 GMT -5
There's a code for moving instances towards each other, but not away. How can I do this then? Also, how can I incoperate the built in potential scripts for moving around solids with it (so that while it's moving away it's moving around objects) Sorry it's been so long since my last post.
|
|
|
Post by IsmAvatar on Aug 29, 2004 13:55:15 GMT -5
you can simply incorporate move_away by using move_towards, and then direction += 180. As for avoiding obstacles, you'll have to use some trig functions (mentioned below) to calculate a point away from the enemy and then move towards that point avoiding obstacles. Trig functions: point_direction point_distance lengthdir_x lengthdir_y
|
|
|
Post by kegy on Sept 18, 2004 22:24:41 GMT -5
if (distance_to_object(character)>3) { move_towards_point(character.x,character.y,4); } Where would the 180 go?
|
|
|
Post by kegy on Sept 18, 2004 22:28:57 GMT -5
never mind i got it
|
|
|
Post by megamushroom on Oct 11, 2004 13:01:19 GMT -5
or set the speed as a minus...
|
|