Advertisement
Guest User

Untitled

a guest
May 28th, 2017
53
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. function moveGuards(){
  2.     var guardDirection = "right";
  3.     if (guards[0].x >= 14 * tileSize && guardDirection == "right") {
  4.         guardDirection = "left";
  5.         guards[0].gotoAndPlay("left");
  6.         guards[0].x--;
  7.     } else {
  8.         guardDirection = "right";
  9.         guards[0].x++;
  10.     }
  11. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement