Guest User

Untitled

a guest
Mar 1st, 2013
35
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1.  handleDesktopInput: function() {
  2.             if (ig.input.state('left')) {
  3.                 this.vel.x = -this.speed;
  4.             } else if (ig.input.state('right')) {
  5.                 this.vel.x = this.speed;
  6.             } else {
  7.                 this.vel.x = 0;
  8.             }
  9.             if (ig.input.state('up')) {
  10.                 this.vel.y = -this.speed;
  11.             } else if (ig.input.state('down')) {
  12.                 this.vel.y = this.speed;
  13.             } else {
  14.                 this.vel.y = 0;
  15.             }
  16.             this.angle = this.angleTo(this.crosshair);
  17.             var isShooting = ig.input.state('shoot');
  18.             if (isShooting && this.lastShootTimer.delta() > 0) {
  19.                 this.shoot();
  20.                 this.lastShootTimer.set(0.05);
  21. }
RAW Paste Data