main
The single scene of **Trebuchet Castle Siege**. It is the field the whole game plays out on: a grass plain, a treeline horizon, an earth mound with a road running up to it, and the sky and sun that light them.
scenes.main — the siege field
The single scene of Trebuchet Castle Siege. It is the field the whole game plays out on: a grass plain, a treeline horizon, an earth mound with a road running up to it, and the sky and sun that light them.
What the scene owns
- Terrain and dressing —
ground,hill,hill_crown,road, and thetreelinegroup of forty trees that closes the horizon. - Lighting —
ambient, a directionalsunset for a low afternoon angle, and a proceduralsky. - The player setup — a PlayerPrototype (body + CameraRig) under
PlayerSetups, and a PlayerSpawn underSpawns. On join the prototype is cloned for the connecting user, so the world works with any number of players present. SiegeGame— one entity carrying theSiegeGamecomponent, which is the game itself: menus, HUD, castle construction, ballistics, defenders, and progression.
What the scene does NOT own
Everything that changes during a siege is built at runtime by SiegeGame
and torn down again when the siege ends — the trebuchet, the castle's
stones, the garrison, projectiles, debris, fires and the music host. Loading
this scene in edit mode therefore shows an empty field: that is correct. The
castle appears when a siege starts.
Camera
SiegeCam drives the play camera. It orbits the trebuchet while you lay the
engine, and — when follow is on (F) — tracks the stone through its arc
and holds on the impact before easing back.
Entrypoint
entrypoint.luau carries the stock scene lifecycle hooks. The game needs
none of them; SiegeGame does its own setup in awake and start, so the
hooks are left commented out rather than dispatching empty bodies each
frame.
Scoped to this part · feeds back into the world's score.