Move back and forth
Jamwithno
Member Posts: 312
i want the enemy to go back and forth. right now i have it so that when the enemy touches and enemy wall it goes the opposite direction but its not working. Do you guys know of any other ways of doing this?
Comments
Make a game text attribute called Direction, set its value to right.
Place your Actor enemy wall for the left and right walls. Unlock both, in the left wall's Rules put:
When Actor receives event overlaps or collides with actor of type Enemy
Change Attribute game.Direction to right
and in the other wall:
When Actor receives event overlaps or collides with actor of type Enemy
Change Attribute game.Direction to left
Then in the Enemy (moving) actor's Rules:
When Attribute game.Direction is right
Move Direction 0 relative to scene, chosen speed
When Attribute game.Direction is left
Move Direction 180 relative to scene, chosen speed
Hope it helps. :-)
""You are in a maze of twisty passages, all alike." - Zork temp domain http://spidergriffin.wix.com/alphaghostapps
""You are in a maze of twisty passages, all alike." - Zork temp domain http://spidergriffin.wix.com/alphaghostapps