Clear the hook on new level

parent 25455273
......@@ -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) {
......
......@@ -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
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment