Skip to content

Commit

Permalink
add downward & upward camera movement
Browse files Browse the repository at this point in the history
  • Loading branch information
nicoecheza committed Nov 6, 2024
1 parent 680459b commit fb39a26
Showing 1 changed file with 4 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -145,12 +145,16 @@ export class CameraManager {
camera.keysUp = [Keys.KEY_W, Keys.KEY_UP]
camera.keysLeft = [Keys.KEY_A, Keys.KEY_LEFT]
camera.keysRight = [Keys.KEY_D, Keys.KEY_RIGHT]
camera.keysDownward = [Keys.KEY_Q]
camera.keysUpward = [Keys.KEY_E]

function isCameraMoving(): boolean {
for (const key of camera.keysDown) if (keyState[key]) return true
for (const key of camera.keysUp) if (keyState[key]) return true
for (const key of camera.keysLeft) if (keyState[key]) return true
for (const key of camera.keysRight) if (keyState[key]) return true
for (const key of camera.keysDownward) if (keyState[key]) return true
for (const key of camera.keysUpward) if (keyState[key]) return true
return false
}

Expand Down

0 comments on commit fb39a26

Please sign in to comment.