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:
co-authored by
Claude Opus 5.5
parent
f4b671678e
commit
183821737e
@@ -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()))
|
||||
Reference in New Issue
Block a user