better controls
This commit is contained in:
parent
a5b1436769
commit
e87632f1ba
2 changed files with 5 additions and 5 deletions
|
@ -118,7 +118,7 @@ Game.prototype.click = function () {
|
||||||
if (player.health <= 0) {
|
if (player.health <= 0) {
|
||||||
game = new Game();
|
game = new Game();
|
||||||
} else {
|
} else {
|
||||||
player.bump(game);
|
player.bump();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -20,11 +20,11 @@ Player.prototype.bump = function () {
|
||||||
player.dir *= -1;
|
player.dir *= -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
player.vel.x *= 0.9;
|
player.vel.x *= 0.3;
|
||||||
player.vel.y *= 0.9;
|
player.vel.y *= 0.3;
|
||||||
|
|
||||||
player.vel.x += Math.sin(player.rot) * 8;
|
player.vel.x += Math.sin(player.rot) * 12;
|
||||||
player.vel.y -= Math.cos(player.rot) * 8;
|
player.vel.y -= Math.cos(player.rot) * 12;
|
||||||
|
|
||||||
player.ticks = 0;
|
player.ticks = 0;
|
||||||
}
|
}
|
Loading…
Reference in a new issue