PoliGuard - changes made for this site
======================================
Original: https://github.com/IonMateus/poliguard
Commit: 51bdc99209741bc8f600c177e68ac3be6b0f837f (version 1.1.3 in docs/CHANGELOG.md)
License: MIT, Copyright (c) 2025 Ion Mateus (see LICENSE)
Files: game/pages/game.html -> index.html, game/scripts/index.js ->
scripts/index.js, game/styles/style.css -> styles/style.css (unchanged).
The landing page (index.html, website/), docs/ and the save.txt backup copies
were not copied.
index.html
-
"Document" changed to "PoliGuard".
- Removed the Tailwind Play CDN script (cdn.tailwindcss.com), the Google Fonts
link (Inter, Orbitron) and the tailwind_config.js script. Added
styles/tailwind.css (see below) and styles/fit.css. Text falls back to the
system sans-serif font.
- Removed the "Return" button (it called an undefined window.redirect() and
pointed to the project's landing page) and the "Go to home page" button on
the game-over screen (it called an undefined goHome()). "Play new game" is
kept.
styles/tailwind.css (new)
- Compiled with tailwindcss 3.4.17 (MIT, Tailwind Labs; license in
LICENSE-tailwindcss.txt) from the classes used in index.html and
scripts/index.js, using the theme from the original
game/styles/tailwind_config.js. It replaces the Play CDN, which built the
same CSS in the browser at runtime.
styles/fit.css (new)
- Sizes the 1000x480 game canvas to fit the frame next to the tower panel.
- Sets body text to white; the original set no text color, so the money,
lives, score and wave numbers in the top bar were black on black.
scripts/index.js
- Mouse coordinates are converted from CSS pixels to canvas pixels
(x canvas.width / rect.width) in the mousemove, drag, wheel, click and
right-click handlers, so the canvas can be displayed at any size.
- Right-click (tower targeting menu) now uses the same zoom/camera conversion
as left-click; before, it never found a tower at the default zoom.
- Starting zoom changed from 0.5 to 1, so the whole path fills the canvas at
the start (mouse wheel zoom from 0.5 to 1.5 still works).
- Added function updateDisplay() { updateUI(); } - the upgrade and sell code
called updateDisplay(), which was never defined, and threw an error.
- Canvas text font 'bold 16px Inter' -> 'bold 16px Inter, sans-serif'.
Line endings (CRLF) are preserved. Towers, enemies, waves, costs and all
other gameplay values are unchanged.