Summary Files Commits Branches @commit @diff @stats
diff options
context:
space:
mode:
Commitd8015a3653bb820f7df93660fe7dfa2368690312 (patch)
Author
 Syndamia <kamen@syndamia.com>
2023-08-27 15:32:04 +0300
Committer
 Syndamia <kamen@syndamia.com>
2023-08-27 15:32:04 +0300
Files56eecc75b8ae3bab188c4bd8e7f804c168c94b99
uni-projects-d8015a3653bb820f7df93660fe7dfa2368690312.tar
uni-projects-d8015a3653bb820f7df93660fe7dfa2368690312.tar.gz
uni-projects-d8015a3653bb820f7df93660fe7dfa2368690312.zip
Parent17708867019c5fcdc68b0f7f4725aede551fc94a (diff)
[WGL/P] You can now pause and unpause with the escape key
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();
+ });
}
/*