Clear the hook on new level
This commit is contained in:
parent
25455273ed
commit
c9c1e9c4c4
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user