slight gameplay changes
This commit is contained in:
parent
fd7f909a8c
commit
7c509e9572
2 changed files with 9 additions and 3 deletions
|
@ -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;
|
||||
}
|
||||
|
|
|
@ -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();
|
||||
|
|
Loading…
Reference in a new issue