Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- handleDesktopInput: function() {
- if (ig.input.state('left')) {
- this.vel.x = -this.speed;
- } else if (ig.input.state('right')) {
- this.vel.x = this.speed;
- } else {
- this.vel.x = 0;
- }
- if (ig.input.state('up')) {
- this.vel.y = -this.speed;
- } else if (ig.input.state('down')) {
- this.vel.y = this.speed;
- } else {
- this.vel.y = 0;
- }
- this.angle = this.angleTo(this.crosshair);
- var isShooting = ig.input.state('shoot');
- if (isShooting && this.lastShootTimer.delta() > 0) {
- this.shoot();
- this.lastShootTimer.set(0.05);
- }
RAW Paste Data