slight gameplay changes
This commit is contained in:
parent
9a701d88dc
commit
d764b94f11
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;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue