Web, Commodore, Windows version, Linux standalone, Windows Screensaver complete.

This commit is contained in:
The Dust Council 2026-06-05 00:39:31 -07:00
parent 47730936de
commit 9257f21598
19 changed files with 794 additions and 18 deletions

37
web/index.html Normal file
View file

@ -0,0 +1,37 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Vectorgons</title>
<style>
html, body { margin: 0; height: 100%; background: #000; color: #8af;
font-family: system-ui, sans-serif; }
#wrap { display: flex; flex-direction: column; align-items: center; gap: 8px;
padding: 12px; box-sizing: border-box; }
#canvas { background: #000; border: 1px solid #234; outline: none;
width: 1100px; height: 760px; max-width: 100%; }
/* In fullscreen, fill the whole screen. The program resizes the canvas
backing buffer to the screen resolution (see on_fullscreen_change), so it
renders at the screen's aspect ratio and fills it edge-to-edge with no
black bars and no distortion. */
#canvas:fullscreen,
#canvas:-webkit-full-screen {
width: 100vw; height: 100vh; max-width: none; border: 0; background: #000;
}
#hint { font-size: 13px; opacity: .6; }
</style>
</head>
<body>
<div id="wrap">
<!-- The canvas must have id="canvas" and be focusable (tabindex) for keys. -->
<canvas id="canvas" width="1100" height="760" tabindex="0"></canvas>
<div id="hint">Click the canvas, then use the on-screen controls (WASD / arrows / etc.). F = fullscreen.</div>
</div>
<!-- External scripts only, so this page works under a strict CSP (script-src
'self'). vectorgons-boot.js must load before vectorgons.js. -->
<script src="vectorgons-boot.js"></script>
<script src="vectorgons.js"></script>
</body>
</html>

16
web/vectorgons-boot.js Normal file
View file

@ -0,0 +1,16 @@
// Emscripten Module config, in an external file so it loads under a strict CSP
// (script-src 'self') without needing 'unsafe-inline'. Must load BEFORE
// vectorgons.js. The canvas (id="canvas") must already exist in the DOM.
var Module = {
canvas: (function () {
var c = document.getElementById('canvas');
c.addEventListener('click', function () { c.focus(); });
// Don't let arrow keys / space scroll the page while playing.
c.addEventListener('keydown', function (e) {
if ([32, 37, 38, 39, 40].indexOf(e.keyCode) >= 0) e.preventDefault();
});
return c;
})(),
print: function (t) { console.log(t); },
printErr: function (t) { console.error(t); }
};

1
web/vectorgons.js Normal file

File diff suppressed because one or more lines are too long

BIN
web/vectorgons.wasm Executable file

Binary file not shown.