Store art: posters
Store art made by the game's own code (game.poster), and pictures to look at (shot).
game.poster(name, setup) registers a staged scene for the game page. Opening the game with ?poster=cover draws that scene
instead of the game, at an exact size and a pixel ratio of 1, frozen and deterministic. npx @onceworlds/cli posters opens your
latest draft that way and saves a picture of each into store/<name>.png, naming icon and the 16:9 pictures in
onceworlds.json when it has none.
game.poster('cover', (p) => { // 1920 x 1080 by default; 'icon' is 512 x 512, 'badge-*' 256 x 256
p.camera({ height: 10, clear: '#203040' });
p.world.spawn([Transform(), Shape2D({ shape: 'circle', radius: 2, fill: '#ffd23f' })]);
feelOf(p.world).particles.burst('confetti', { x: 0, y: -4 });
p.settle(0.8); // simulate a little first, with the seed fixed
});
- Icon: one simple subject (the player, the main object) on a plain or softly shaded background, no words, nothing important in the outer 10%. Thumbnails: three to five, the first (the cover) the best picture of the game being played: real action with several things going on, the subject in the middle, any word short and large. Not the title screen, not a logo.
- Compose the scene on purpose: spawn the characters in a pose, set the camera, burst the particles,
settlea moment. Look at the result at 128 px wide: if you can't tell what the game is, redo it.
Rules of play leave the poster alone
While a poster is staged, Flow's phase is 'playing', so the HUD and what animates play can pose the scene, and p.settle runs the
game's systems, the host's rules included. A rule that only checks the phase runs inside the poster: it starts a wave, drops the
pieces you posed or ends the round while the picture settles. Guard every rule of play with the poster as well:
const Waves = defineSystem({
name: 'waves', stage: 'fixed', authority: 'host',
run({ flow, world }) {
if (flow.phase !== 'playing' || flow.poster) return; // flow.poster: the poster's name while one is staged, else null
// ... the rule
},
});
Without Flow, poster?.active says the same in a system (run({ poster })), and servicesOf(game).poster?.active anywhere else. A
view that is only for the store (a title over the cover) shows when: () => servicesOf(game).poster?.active === 'cover'.
Pictures to look at: shot
npx @onceworlds/cli shot saves a PNG of the game for you to look at (the MCP tool screenshot returns it to the model directly):
shotalone: the first player's screen 8 seconds into a simulated match with bots (--at 20for later).--phase titleis the title screen and--phase lobbythe lobby (Play pressed, nobody ready);--phase playis the default.--poster coverdraws a poster instead.--size 390x844is a phone held upright. The MCP toolscreenshottakes the same (phase,poster,at).shot --story(story: true) is the first minute a new player lives, frame by frame intostore/story/and on one contact sheet,store/story.png: the title, the lobby, the countdown, the round's goal, play at +1, +5 and +12 s, the first result. It prints the questions to ask of it (theonboardingtopic);--atis how long to follow the game (120 s).- A 2D game draws without a browser, from the same draw list the game sends to the screen (text in the game's fonts, Sora for the
rest; not the HTML overlay). A 3D game, or
--browser, is drawn by Chrome, Chromium or Edge on this computer from a local copy of the game, opened with?autoplay: a game on Flow presses Play and starts its match by itself, and the picture waits for a moment of play (?autoplay-to=titleorlobbyfor--phase). - Look at it at the size a player sees it: can you tell what the game is, who you are, what to do and the score?