TINY SHOP — cozy 3D shop-management game (Three.js vertical slice)
- Procedural 3D world: dollhouse shop, town, day/night, weather, seasons - Customer AI with personalities (story NPCs, thieves, weekly regulars) - Economy: suppliers, negotiation, pricing psychology, daily accounting - Staff with traits/loyalty, 8 expansion levels, furniture & decoration - Events with choices, quests, achievements, 4 difficulties, rival shop - Animated daily report, analytics, save/load (3 slots + autosave) - Procedural music & SFX (WebAudio), zero external assets - Test harnesses: simtest (node), verify/check/e2e (headless browser)
This commit is contained in:
@@ -0,0 +1,61 @@
|
||||
import puppeteer from 'puppeteer';
|
||||
|
||||
const URL = 'http://127.0.0.1:4939';
|
||||
const shots = process.argv[2] || 'menu';
|
||||
|
||||
const browser = await puppeteer.launch({
|
||||
headless: true,
|
||||
args: [
|
||||
'--no-sandbox', '--disable-setuid-sandbox',
|
||||
'--enable-unsafe-swiftshader',
|
||||
'--use-gl=angle', '--use-angle=swiftshader',
|
||||
'--window-size=1280,720',
|
||||
],
|
||||
});
|
||||
const page = await browser.newPage();
|
||||
await page.setViewport({ width: 1280, height: 720 });
|
||||
|
||||
const errors = [];
|
||||
page.on('console', (msg) => {
|
||||
if (msg.type() === 'error') errors.push('[console.error] ' + msg.text());
|
||||
});
|
||||
page.on('pageerror', (err) => errors.push('[pageerror] ' + err.message));
|
||||
|
||||
await page.goto(URL, { waitUntil: 'networkidle0', timeout: 60000 });
|
||||
await new Promise(r => setTimeout(r, 3500));
|
||||
await page.screenshot({ path: '/tmp/shot_menu.png' });
|
||||
console.log('menu shot done');
|
||||
|
||||
if (shots !== 'menu') {
|
||||
// start a new game through the wizard
|
||||
await page.evaluate(() => { document.getElementById('m-new').click(); });
|
||||
await new Promise(r => setTimeout(r, 600));
|
||||
await page.evaluate(() => {
|
||||
const inp = document.querySelector('#wiz-name');
|
||||
if (inp) { inp.value = 'The Gilded Carrot'; inp.dispatchEvent(new Event('input')); }
|
||||
});
|
||||
await page.screenshot({ path: '/tmp/shot_wizard.png' });
|
||||
await page.evaluate(() => { document.querySelector('#wiz-start')?.click(); });
|
||||
await new Promise(r => setTimeout(r, 2500));
|
||||
await page.screenshot({ path: '/tmp/shot_game.png' });
|
||||
console.log('game shot done');
|
||||
|
||||
// open a panel
|
||||
await page.evaluate(() => { document.querySelector('.nav-btn[data-panel="suppliers"]')?.click(); });
|
||||
await new Promise(r => setTimeout(r, 800));
|
||||
await page.screenshot({ path: '/tmp/shot_panel.png' });
|
||||
console.log('panel shot done');
|
||||
|
||||
// buy something & stock & speed up time to see customers
|
||||
await page.evaluate(() => {
|
||||
document.querySelector('.nav-btn[data-panel="inventory"]')?.click();
|
||||
window.__TS.G.timeScale = 3;
|
||||
window.__TS.G.paused = false;
|
||||
});
|
||||
await new Promise(r => setTimeout(r, 4000));
|
||||
await page.screenshot({ path: '/tmp/shot_later.png' });
|
||||
console.log('later shot done');
|
||||
}
|
||||
|
||||
console.log('ERRORS:', errors.length ? '\n' + errors.join('\n') : 'none');
|
||||
await browser.close();
|
||||
Reference in New Issue
Block a user