better controls

This commit is contained in:
biglyderv 2024-09-28 20:10:23 -04:00
parent a5b1436769
commit e87632f1ba
No known key found for this signature in database
GPG key ID: 33AC87E9ACE66954
2 changed files with 5 additions and 5 deletions

View file

@ -118,7 +118,7 @@ Game.prototype.click = function () {
if (player.health <= 0) {
game = new Game();
} else {
player.bump(game);
player.bump();
}
}

View file

@ -20,11 +20,11 @@ Player.prototype.bump = function () {
player.dir *= -1;
}
player.vel.x *= 0.9;
player.vel.y *= 0.9;
player.vel.x *= 0.3;
player.vel.y *= 0.3;
player.vel.x += Math.sin(player.rot) * 8;
player.vel.y -= Math.cos(player.rot) * 8;
player.vel.x += Math.sin(player.rot) * 12;
player.vel.y -= Math.cos(player.rot) * 12;
player.ticks = 0;
}