This commit is contained in:
2026-08-08 18:00:34 +02:00
commit 41e307b5c1
28 changed files with 4728 additions and 0 deletions
+19
View File
@@ -0,0 +1,19 @@
// About me: Writes assets/gameart.png from the generated artwork in src/gameart.ts.
// Kept as a separate step from the build so the committed image only changes when
// someone deliberately regenerates it.
//
// Usage: node scripts/make-gameart.mjs [outputPath]
import { mkdirSync, writeFileSync } from 'node:fs';
import { dirname, resolve } from 'node:path';
import { fileURLToPath } from 'node:url';
import { encodePng, renderGameArt } from '../src/gameart.ts';
const projectRoot = resolve(dirname(fileURLToPath(import.meta.url)), '..');
const output = resolve(projectRoot, process.argv[2] ?? 'assets/gameart.png');
mkdirSync(dirname(output), { recursive: true });
const png = encodePng(renderGameArt());
writeFileSync(output, png);
console.log(`wrote ${output} (${png.length} bytes)`);