summaryrefslogtreecommitdiff
path: root/2026/games_submissions/crm148/view.js
diff options
context:
space:
mode:
authorLLLL Colonq <llll@colonq>2026-08-04 04:35:44 -0400
committerLLLL Colonq <llll@colonq>2026-08-04 04:35:44 -0400
commit3c7796f066647090ed8436778bdfe25f11844c05 (patch)
tree0644a101004d91af4fcdc2f51fcc2e03f7f255ce /2026/games_submissions/crm148/view.js
parenta75221ab93f59d688f90cd83f0284ff98951fcfa (diff)
Prepare for upload
Diffstat (limited to '2026/games_submissions/crm148/view.js')
-rw-r--r--2026/games_submissions/crm148/view.js32
1 files changed, 0 insertions, 32 deletions
diff --git a/2026/games_submissions/crm148/view.js b/2026/games_submissions/crm148/view.js
deleted file mode 100644
index 1d2fb5c..0000000
--- a/2026/games_submissions/crm148/view.js
+++ /dev/null
@@ -1,32 +0,0 @@
-
-import Vec2 from './vec2.js';
-
-class View {
- center = Vec2.zero();
- zoom = 1.0;
-
- // Convert game coordinate to canvas coordinate
- project(vec2) {
- return new Vec2(
- (gameCanvas.width / 2) + ((vec2.x - this.center.x) * this.zoom),
- (gameCanvas.height / 2) - ((vec2.y - this.center.y) * this.zoom));
- }
- // Covert canvas coordinate to game coordinate
- unproject(vec2) {
- return new Vec2(
- this.center.x + (vec2.x - (gameCanvas.width / 2)) / this.zoom,
- this.center.y - (vec2.y - (gameCanvas.height/2)) / this.zoom);
- }
-}
-
-function globalView() {
- return gView;
-}
-
-var gView = new View();
-window.view = gView;
-
-export {
- View,
- globalView,
-}