Skip to content

Commit

Permalink
fix debug draw toggle
Browse files Browse the repository at this point in the history
  • Loading branch information
jeffomatic committed Dec 25, 2020
1 parent fcbedb6 commit f5bf4e4
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions src/Client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -132,12 +132,6 @@ export class Client {
this.framesAheadOfServer = new RunningAverage(3 * 60)
this.serverInputsPerFrame = new RunningAverage(3 * 60)

document.addEventListener('keyup', (event) => {
if (event.code === 'backquote') {
this.enableDebugDraw = !this.enableDebugDraw
}
})

// Common
this.state = GameState.Connecting
this.nextState = undefined
Expand Down Expand Up @@ -355,6 +349,10 @@ export class Client {
)
}

if (this.keyboard.upKeys.has('Backquote')) {
this.enableDebugDraw = !this.enableDebugDraw
}

this.keyboard?.update()
this.mouse?.update()

Expand Down

0 comments on commit f5bf4e4

Please sign in to comment.