Log inGet started
World

Bola na Rede: Arcade Football

Branchmain
Branchesmain
Commitb1c645e16b

README.md

sim/match

The Bola na Rede match simulation and its public API, called by the shell and the scene.

local Match = require("sim.match")
Match.start({ home = "praia", away = "trovao", difficulty = "normal", minutes = 3, humanTeam = "home" })
Match.on("goal", function(e) print(e.team, e.scorer) end)
local s = Match.state()
Match.pause(true)
Match.quit()
  • start(opts): home/away are team definitions or ids from sim.teams; difficulty easy|normal|hard|lenda; minutes; humanTeam "home"|"away"|nil (nil = CPU vs CPU); intro=false skips the walkout.
  • on(name, fn) returns an unsubscribe function. Events and payloads per CONTRACT.md, plus result at full time.
  • state() per CONTRACT.md, plus period (regular|golden|shootout), controlled, result, goal, shootout.
  • autostart (default true): the scene starts a human match on entering play; the shell sets it false and calls start itself.
  • setCameraStyle("broadcast"|"close"), stats().

Phases: idle, intro, kickoff, play, goal, golden (banner before golden goal), shootout, fulltime.