Making a path
Hello guys,
here's my «problem». I'm making for a school project a kind of maze level in which there is my actor who is constrained to my mouse and enemies who I want to follow a predefined path in my maze. I'm pretty new to GS so the solution I cam up with was to create a few actors that when my enemy collides with it, the enemy changes direction.
So here's what I've done. On my enemy, I've put to start a :
Move behavior. 270 degrees relative to actor.
Rule : When actor collides with actor of type waypoint 1,
Move behavior, 180 degrees relative to actor.
So now what happens is that my ennemy comes down like I want to, but when it touches the waypoint, it goes down and left I the same time and when it's no more touching the waypoint actor, it goes down again, ignoring my new behavior. I understand that it does that because the rule is temporary to overlaping the waypoint and not permanent.
How do I make it permanent until it touches another waypoint ?
Thank you.
here's my «problem». I'm making for a school project a kind of maze level in which there is my actor who is constrained to my mouse and enemies who I want to follow a predefined path in my maze. I'm pretty new to GS so the solution I cam up with was to create a few actors that when my enemy collides with it, the enemy changes direction.
So here's what I've done. On my enemy, I've put to start a :
Move behavior. 270 degrees relative to actor.
Rule : When actor collides with actor of type waypoint 1,
Move behavior, 180 degrees relative to actor.
So now what happens is that my ennemy comes down like I want to, but when it touches the waypoint, it goes down and left I the same time and when it's no more touching the waypoint actor, it goes down again, ignoring my new behavior. I understand that it does that because the rule is temporary to overlaping the waypoint and not permanent.
How do I make it permanent until it touches another waypoint ?
Thank you.
Comments
Then when your actor overlaps a waypoint, have it change the local attribute to the waypoint number.
Then in your rules, if self.waypoint = 1 do this, if self.waypoint = 2 do that
Send and Receive Data using your own Server Tutorial! | Vote for A Long Way Home on Steam Greenlight! | Ten Years Left