better controls

This commit is contained in:
biglyderv 2024-11-25 14:14:20 -05:00
parent 4260eefafe
commit e255982fef
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;
}