The pages around a game's worlds in a browser: a title, a lobby of arenas, the
arena, settings and the guide, from a Cauldron2D.Client.Game, as a plug a game
forwards a path to.
forward "/play", Cauldron2D.Net.Pages, game: MyGame.Client, username: &MyGame.Web.Auth.username/1, token: &MyGame.Web.Auth.token/1, login: "/login"The pages also serve the atlas as atlas.png, cauldron.js and phoenix.min.js,
and arenas.json for the lobby to refresh from. Links follow the path the pages are
mounted at. The arena page mounts cauldron.js on the game's channel with the
player's settings — the preset and the levels, kept in the browser by the settings
page — and shows the round's end over the canvas with a way back to the lobby.
Options
:game— the module. Required:username— a function from the conn to the player's name, ornilwhen nobody is signed in. Default: the conn's:usernameassign:token— a function from the conn to the token the socket connects with, sent as thetokensocket param. Default: none:login— where to send a visitor with no name. Default: none, the page says so:socket— the socket's path. Default"/socket":topic— the channel topic prefix, asCauldron2D.Net.Channeltakes it. Default"world":scale— pixels a tile on the canvas. Default32
Summary
Functions
@spec assigned_username(Plug.Conn.t()) :: String.t() | nil
The default :username: the conn's :username assign.
@spec no_token(Plug.Conn.t()) :: nil
The default :token: none.