diff doc/architecture.md @ 32:85d23328a215 0.10.0

added intro music, logic for browser audio triggering on splash screen
author ark
date 2026-10-20 18:39 +0200
parents 75deda08db90
children a464bd43b76c
line wrap: on
line diff
--- a/doc/architecture.md	Tue Oct 20 17:58:10 2026 +0200
+++ b/doc/architecture.md	Tue Oct 20 18:39:22 2026 +0200
@@ -76,11 +76,14 @@
 reachable from outside, so other screens are reached by tapping: -J runs
 javascript after the wait, and -S waits again before capturing. a pointer
 event sent to the canvas counts as a tap at that position in css pixels.
-this taps the play button on the splash screen at 1024 x 768:
+a fresh firefox profile has no stored settings, so the splash screen first
+shows the sound button over the play button (sound.md). this taps it, and
+the play button a second later, at 1024 x 768:
 
-    ff_screenshot -w 1024,768 -s 2 -S 3 -J 'document.getElementById("game")
-        .dispatchEvent(new PointerEvent("pointerdown",
-        {clientX: 497, clientY: 560, bubbles: true}))' \
+    ff_screenshot -w 1024,768 -s 2 -S 3 -J 'function tap() {
+        document.getElementById("game").dispatchEvent(new PointerEvent(
+        "pointerdown", {clientX: 497, clientY: 560, bubbles: true})) }
+        tap(); setTimeout(tap, 1000)' \
         file://$PWD/www/index.html temp/play.png
 
 `ff_screenshot -h` lists the other options.
@@ -291,7 +294,8 @@
     js/util.js      vector maths, random numbers, easing
     js/storage.js   settings kept in the browser
     js/assets.js    image loading, sprite table
-    js/audio.js     recorded sounds, placeholder beeps for the other events
+    js/audio.js     recorded sounds, placeholder beeps for the other events,
+                    splash screen music
     js/map.js       placement lookup, snapping, route sampling
     js/monster.js   movement along a route, hops, slow, hp
     js/tower.js     targeting, attacks, upgrade, sell