17 lines
516 B
Scala
17 lines
516 B
Scala
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()))
|