From 761a3172bf4c15aed3836e4d1cd6f815b651b0e0 Mon Sep 17 00:00:00 2001 From: LLLL Colonq Date: Sat, 29 Aug 2026 04:06:51 -0400 Subject: Fix --- 2026/games_submissions/crm148/view.js | 32 -------------------------------- 1 file changed, 32 deletions(-) delete mode 100644 2026/games_submissions/crm148/view.js (limited to '2026/games_submissions/crm148/view.js') 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, -} -- cgit v1.3.1