Summary Files Commits Branches @commit @diff @stats
diff options
context:
space:
mode:
1 files changed, 3 insertions, 0 deletions
-rw-r--r--Year 2/Computer Graphics with WebGL/Project/spaceship.js3
diff --git a/Year 2/Computer Graphics with WebGL/Project/spaceship.js b/Year 2/Computer Graphics with WebGL/Project/spaceship.js
index 654b451..5b98229 100644
--- a/Year 2/Computer Graphics with WebGL/Project/spaceship.js
+++ b/Year 2/Computer Graphics with WebGL/Project/spaceship.js
@@ -142,6 +142,9 @@ function mouseInit() {
if (isPaused)
await canvas.requestPointerLock();
});
+ document.addEventListener('keyup', (e) => {
+ if (e.key === 'Escape') paused.click();
+ });
}
/*