diff game/js/input.js @ 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 3f2811aebb3d
children 83e8b0e0f010
line wrap: on
line diff
--- a/game/js/input.js	Tue Oct 20 17:58:10 2026 +0200
+++ b/game/js/input.js	Tue Oct 20 18:39:22 2026 +0200
@@ -13,8 +13,8 @@
     var DRAG_SLOP = 10;
     var REFUSED_TIME = 500;
 
-    // app: {canvas, view, game(), layout(), and the screen actions play(),
-    // next(), retry(), restart()}
+    // app: {canvas, view, game(), layout(), and the screen actions
+    // startSound(), play(), next(), retry(), restart()}
     function attach(app) {
         var c = app.canvas;
         // the press that moves the placement preview, followed until the
@@ -107,7 +107,8 @@
             if (b.id !== "sell") game.sellArmed = false;
             if (b.id !== "sell" && b.id !== "upgrade") game.selected = null;
             if (b.id === "logo" || b.id === "email") return { game: game, button: b.id };
-            if (b.id === "play") app.play();
+            if (b.id === "start_sound") app.startSound();
+            else if (b.id === "play") app.play();
             else if (b.id === "next") app.next();
             else if (b.id === "retry") app.retry();
             else if (b.id === "restart") app.restart();