mirror of
https://github.com/PlayableIntelligence/game-creator.git
synced 2026-09-19 07:34:10 +08:00
f4b0812aa8
Two robots (Blue Bomber and Red Rocker) face off in a boxing ring. Player controls the Blue Bomber with A/D/W keys or touch tap zones. Red Rocker is AI-controlled with timing-based punch/block patterns. Each hit reduces opponent head health; at zero, head pops up = knockout. Score tracks rounds won. Game over when player gets knocked out. Core systems: CombatSystem (damage, cooldowns, hit detection), AISystem (timing patterns, reactive blocking), AnimationSystem (punch/block/head-pop animations on primitive-built robots), InputSystem (keyboard + mobile touch zones). Includes spectacle events, combo tracking, and design-brief.md. Co-Authored-By: Claude <noreply@anthropic.com>
57 lines
1.7 KiB
JavaScript
57 lines
1.7 KiB
JavaScript
#!/usr/bin/env node
|
|
// =============================================================================
|
|
// verify-runtime.mjs — Headless runtime verification for browser games
|
|
//
|
|
// Launches headless Chromium, loads the game, checks for runtime errors
|
|
// (WebGL failures, uncaught exceptions, console errors).
|
|
// Exit 0 = pass, Exit 1 = fail (prints errors to stderr).
|
|
//
|
|
// Usage:
|
|
// node scripts/verify-runtime.mjs
|
|
// PORT=5173 node scripts/verify-runtime.mjs
|
|
// =============================================================================
|
|
|
|
import { chromium } from '@playwright/test';
|
|
|
|
const PORT = process.env.PORT || 3000;
|
|
const URL = `http://localhost:${PORT}`;
|
|
const WAIT_MS = 3000;
|
|
|
|
async function verify() {
|
|
const errors = [];
|
|
const browser = await chromium.launch({ headless: true });
|
|
const page = await browser.newPage();
|
|
|
|
page.on('pageerror', (err) => errors.push(`PAGE ERROR: ${err.message}`));
|
|
page.on('console', (msg) => {
|
|
if (msg.type() === 'error') {
|
|
errors.push(`CONSOLE ERROR: ${msg.text()}`);
|
|
}
|
|
});
|
|
|
|
try {
|
|
const response = await page.goto(URL, { waitUntil: 'domcontentloaded', timeout: 10000 });
|
|
if (!response || response.status() >= 400) {
|
|
errors.push(`HTTP ${response?.status() || 'NO_RESPONSE'} loading ${URL}`);
|
|
}
|
|
} catch (e) {
|
|
errors.push(`NAVIGATION ERROR: ${e.message}`);
|
|
}
|
|
|
|
// Wait for game to initialize and render
|
|
await page.waitForTimeout(WAIT_MS);
|
|
|
|
await browser.close();
|
|
|
|
if (errors.length > 0) {
|
|
console.error(`Runtime verification FAILED with ${errors.length} error(s):\n`);
|
|
errors.forEach((e, i) => console.error(` ${i + 1}. ${e}`));
|
|
process.exit(1);
|
|
}
|
|
|
|
console.log('Runtime verification PASSED — no errors detected.');
|
|
process.exit(0);
|
|
}
|
|
|
|
verify();
|