diff --git a/common/player.js b/common/player.js index 3aa8f05..9f1be3c 100644 --- a/common/player.js +++ b/common/player.js @@ -38,17 +38,20 @@ class Player extends Entity { bump() { let player = this; - if (player.ticks < 10) { + let f = 1; + + if (player.ticks < 300) { player.dir = -3 * Math.sign(player.dir); } else { + f = 3; player.dir = -0.005 * Math.sign(player.dir); } player.vel.x *= 0.9; player.vel.y *= 0.9; - player.vel.x += Math.sin(player.rot) * 15; - player.vel.y -= Math.cos(player.rot) * 15; + player.vel.x += Math.sin(player.rot) * 15 * f; + player.vel.y -= Math.cos(player.rot) * 15 * f; player.ticks = 0; } diff --git a/static/js/index.js b/static/js/index.js index e742371..9236df7 100644 --- a/static/js/index.js +++ b/static/js/index.js @@ -134,6 +134,9 @@ class Game extends GameBasic { textArgs = [`PT: ${Math.round(player.headCount)}`, 25, 75]; ctx.strokeText(...textArgs); ctx.fillText(...textArgs); + textArgs = [`CH: ${Math.round(player.ticks * 100 / 300)}%`, 25, 125]; + ctx.strokeText(...textArgs); + ctx.fillText(...textArgs); if (player.health <= 0 || player.isMenu) { this.doMenu();