Skip to content

Commit

Permalink
set mouse down if pointer lock released
Browse files Browse the repository at this point in the history
  • Loading branch information
KilledByAPixel authored Feb 22, 2020
1 parent 690eb22 commit 074a174
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion index.html
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@
const checkpointMaxDifficulty = 9; // how many checkpoints before max difficulty
const roadEnd = 1e4; // how many sections until end of the road

// game variables
// global game variables
let playerPos; // player position 3d vector
let playerVelocity; // player velocity 3d vector
let playerPitchSpring; // spring for player pitch bounce
Expand Down Expand Up @@ -192,6 +192,9 @@
return;
}

if (usePointerLock && document.pointerLockElement !== c) // set mouse down if pointer lock released
mouseDown = 1;

UpdateDebugPre(); // DEBUG REMOVE FROM MINFIED

/////////////////////////////////////////////////////////////////////////////////////
Expand Down

0 comments on commit 074a174

Please sign in to comment.