feat(scala): Scala.js browser platform, snake and pong pages, build-web.sh

Co-Authored-By: Claude Opus 5.5 <[email protected]>
This commit is contained in:
Lucas Winther
2026-10-29 00:17:02 +01:00
co-authored by Claude Opus 5.5
parent f4b671678e
commit 183821737e
5 changed files with 123 additions and 0 deletions
+16
View File
@@ -0,0 +1,16 @@
package snake
package web
import scala.scalajs.js.Dynamic.global
// Two programs, one runtime: build-web.sh picks the entry point with --main-class.
private def canvas() = global.document.getElementById("game")
/** scala/index.html: Snake. */
object SnakeMain:
def main(args: Array[String]): Unit = Runtime.runApp(App.main, BrowserPlatform(canvas()))
/** scala/pong.html: Pong (m11). */
object PongMain:
def main(args: Array[String]): Unit = Runtime.runApp(pong.PongApp.pongMain, BrowserPlatform(canvas()))