Add intro screen, win/loss art, and a way to abandon the ritual
- Adds a full-screen intro/title screen (new 'intro' game phase) with a moody Malmö/Turning Torso background and a "Börja ritualen" button; the game no longer starts ticking until the player begins. - Win and loss overlays now show matching generated artwork behind the existing text, instead of a flat scrim. - New "Avbryt" header button lets the player abandon a run mid-game (with a confirm prompt) via a new 'abandoned' phase, reusing the existing overlay/restart flow. - Source images converted from PNG (~2.1MB each) to WebP (~120KB each) and placed under public/img/ so Vite serves them as-is. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
import './style.css';
|
||||
import { createState, tick, buyUpgrade, visitLocation, resolveEventChoice, saveState, loadState, clearSave } from './engine.ts';
|
||||
import { createState, tick, buyUpgrade, visitLocation, resolveEventChoice, startGame, abandonGame, saveState, loadState, clearSave } from './engine.ts';
|
||||
import { initUI, renderState } from './ui.ts';
|
||||
import { initMap, updateMap } from './map.ts';
|
||||
|
||||
@@ -23,7 +23,9 @@ function start(): void {
|
||||
document.getElementById('overlay')!.classList.remove('visible');
|
||||
renderState(state);
|
||||
},
|
||||
(index) => { state = resolveEventChoice(state, index); renderState(state); saveState(state); }
|
||||
(index) => { state = resolveEventChoice(state, index); renderState(state); saveState(state); },
|
||||
() => { state = startGame(state); renderState(state); saveState(state); },
|
||||
() => { state = abandonGame(state); renderState(state); saveState(state); }
|
||||
);
|
||||
|
||||
initMap('map', (locationId) => {
|
||||
|
||||
Reference in New Issue
Block a user