diff --git a/src/game.js b/src/game.js index af248c5..0d13167 100644 --- a/src/game.js +++ b/src/game.js @@ -69,6 +69,7 @@ export class Game { this.time = this.roundTime this.level = Level.create(this.currentLevel, this.oh, this.gw, this.gh) this.goal = Math.floor(this.score / 2 + Game.calculateLevelScore(this.level) * 0.65) + this.player.hook.clear() } displayMessage (msg, time = 60) { diff --git a/src/player.js b/src/player.js index b688d2e..710729b 100644 --- a/src/player.js +++ b/src/player.js @@ -50,6 +50,14 @@ class Hook extends GameObject { ctx.restore() } + clear () { + this.obj = null + this.d = 0 + this.md = -1 + this.x = this.rx + this.y = this.ry + } + update (level) { if (this.d === 0 && this.r < FULL_ROTATION_EDGE && this.rd === 1) { this.r += 1