Advertisement
Guest User

makeInvulnerable

a guest
Aug 17th, 2010
755
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. invulnerable : false,
  2.  
  3. isCatched : function (player) {
  4.     if (!this.invulnerable && player.shape.intersect(this.shape)) {
  5.         this.move();
  6.         // Делаем неуязвимой на 500 мс.
  7.         this.makeInvulnerable(500);
  8.         return true;
  9.     }
  10.     return false;
  11. },
  12.  
  13. makeInvulnerable : function (time) {
  14.     this.invulnerable = true;
  15.     (function () {
  16.         this.invulnerable = false;
  17.     }.bind(this).delay(time));
  18. },
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement