Advertisement
Jhynjhiruu

Frame 1

Jul 4th, 2018
694
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. stop();
  2. if(waittime == undefined)
  3. {
  4.    waittime = 828;
  5. }
  6. if(addrandomly == undefined)
  7. {
  8.    addrandomly = false;
  9. }
  10. if(limit == undefined)
  11. {
  12.    if(chase == true)
  13.    {
  14.       limit = 3;
  15.    }
  16.    else
  17.    {
  18.       limit = "none";
  19.    }
  20. }
  21. if(onlyright == undefined)
  22. {
  23.    onlyright = false;
  24. }
  25. if(onlyleft == undefined)
  26. {
  27.    onlyleft = false;
  28. }
  29. if(lockedside == undefined)
  30. {
  31.    lockedside = false;
  32. }
  33. if(enemyhurt == undefined)
  34. {
  35. }
  36. if(firstrun == undefined)
  37. {
  38.    total = 0;
  39.    if(offset !== undefined)
  40.    {
  41.       count = offset;
  42.    }
  43.    else
  44.    {
  45.       count = 0;
  46.    }
  47.    firstrun = true;
  48. }
  49. else
  50. {
  51.    count = 0;
  52. }
  53. onEnterFrame = function()
  54. {
  55.    if(_root.PauseGame == false)
  56.    {
  57.       if(Math.abs(_root.currentCamX - (_X + _parent._x)) < 1000 && Math.abs(_root.currentCamY - (_Y + _parent._y)) < 1000)
  58.       {
  59.          if(addrandomly == true)
  60.          {
  61.             count = count + 2;
  62.             count = count + Math.random() * 1;
  63.          }
  64.          else
  65.          {
  66.             count++;
  67.          }
  68.          if(count > waittime)
  69.          {
  70.             count = 0;
  71.             if(rot == undefined)
  72.             {
  73.                boolean = _root.currentCamX - (_X + _parent._x) >= 0;
  74.             }
  75.             else if(rot == 180)
  76.             {
  77.                boolean = _root.currentCamX - (_X + _parent._x) <= 0;
  78.             }
  79.             else if(rot == 90)
  80.             {
  81.                boolean = _root.currentCamY - (_Y + _parent._y) >= 0;
  82.             }
  83.             else
  84.             {
  85.                boolean = _root.currentCamY - (_Y + _parent._y) <= 0;
  86.             }
  87.             if(boolean)
  88.             {
  89.                LD = "right";
  90.             }
  91.             else
  92.             {
  93.                LD = "left";
  94.             }
  95.             if((!(onlyright == true && LD == "left") && !(onlyleft == true && LD == "right") || lockedside == true) && (total < limit || limit == "none"))
  96.             {
  97.                play();
  98.                onEnterFrame = function()
  99.                {
  100.                   if(_root.PauseGame == false)
  101.                   {
  102.                      play();
  103.                   }
  104.                   else
  105.                   {
  106.                      stop();
  107.                   }
  108.                };
  109.             }
  110.          }
  111.       }
  112.    }
  113. };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement