Guest User

Untitled

a guest
May 21st, 2018
66
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1.  
  2. /**
  3.  * BoxBot JS
  4.  */
  5.  
  6. function BoxBot() {
  7.  
  8.     var self = this;
  9.  
  10.     this.init = function()
  11.     {
  12.         console.log('BoxBot is alive inside "' + self.player.name + '"');
  13.         // console.log(self.player);
  14.     }
  15.  
  16.  
  17.     this.fight = function()
  18.     {
  19.         // TODO: Make these dynamic according to properties (skill, stamina, etc.)
  20.         setTimeout(function()
  21.         {
  22.             self.player.dodge('left');
  23.         }, 1000, function()
  24.         {
  25.             setTimeout(function()
  26.             {
  27.                 self.player.undodge();
  28.             }, 650);
  29.         });
  30.     }
  31.  
  32. }
  33.  
  34. // EOF
Add Comment
Please, Sign In to add comment