Advertisement
Guest User

Untitled

a guest
Feb 9th, 2016
57
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. update = function()
  2. {
  3.     if (willLasersHit())
  4.     {
  5.         fireLasers();
  6.     }
  7.     if (willMissilesHit())
  8.     {
  9.         fireMissiles();
  10.     }
  11.     closestBot = findClosestEnemyBot();
  12.     if (exists(closestBot))
  13.     {
  14.          if (canMoveTo(closestBot))
  15.          {
  16.             pursue(closestBot);
  17.          }
  18.      
  19.     }
  20.     else
  21.     {
  22.       if(canMove())
  23.       {
  24.           move();
  25.       }
  26.     }
  27.     if(canCloak())
  28.     {
  29.       cloak();
  30.     }
  31.     if(canMove())
  32.     {
  33.       move();
  34.     }
  35.     if(canShield())
  36.     {
  37.       shield();
  38.     }
  39. };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement