Skip to content
Docs
Make your game

Drawings

Draw the pitch, the players and the ball with shapes that follow discs, and choose who sees each one.

The world's discs and walls have no look of their own. What players see is what your game draws: shapes that sit on the field or follow a disc.

Draw the pitch

world.draw makes a shape. Shapes belong to the match, so draw them when it starts:

src/pitch.ts
ShapeDraws
circlea circle, or a disc's body when anchored
boxa rectangle, with rounded corners
polygona closed outline through its points
linea line through its points, with arrows
arcpart of a circle's outline
texta label that stays upright
imagean image from your package
groupthe shapes inside it, moved together

Every shape takes a position, rotation, scale, fill, stroke, strokeWidth, dash and opacity. A shape without fill is hollow; one without stroke has no outline.

Follow a disc

With an anchor, a shape moves with a disc. A circle without a radius takes the disc's. A group keeps shapes together and in order: later shapes are drawn on top.

src/players.ts

Each shape can have an audience: the ring above reaches only its own player.

When a disc is destroyed, the shapes that follow it go too.

Colours

rgb, rgba, hsl and hsla make colours. disko:color mixes them: mix, lighten, darken and withAlpha. The same colours work in chat and in Menu and HUD styles.

Move every frame

Any number can be an expression that every screen works out on each frame, so a shape can spin, pulse or fade with no code in your tick handler:

src/ball.ts

Change and remove

src/banner.ts

See the physics

Test rooms and the Studio can show the physics view over your drawings: every disc, wall, crossing and joint as disko moves them. Use it to check that what players see matches what collides.

See the world reference for every shape and option.