Package-level declarations

Canvas drawing: marks, the board, heat effects, medals, arcade art, glyph icons and the animated backdrop.

Types

Link copied to clipboard
enum Glyph : Enum<Glyph>
Link copied to clipboard
class LudoGeometry(val center: Offset, side: Float)

Where everything sits on the board, in pixels, for a square of side side centred in the canvas. Shared by drawing and tap handling so they always agree.

Link copied to clipboard

Marks are described as polylines in unit space (centred on 0, roughly ±0.3) so that every style can be "drawn in" the same way: by walking a fraction of the total stroke length.

Link copied to clipboard
data class MarkLook(val xColor: Color, val oColor: Color, val style: MarkStyle, val strokeFraction: Float, val animSpeed: Float)

Properties

Link copied to clipboard

Colours for each tetromino (by ordinal) — shared by the game and its artwork.

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard

Functions

Link copied to clipboard
fun AnimatedBackdrop(xColor: Color, oColor: Color, modifier: Modifier = Modifier, tint: Color? = null, tintSide: Float = 0.0f)

Full-bleed animated backdrop: a slow glow plus drifting, rotating ghost X/O marks. Drawn behind the system bars (edge-to-edge).

Link copied to clipboard
fun ArcadeArt(game: ArcadeGame, locked: Boolean, modifier: Modifier = Modifier)

Little animated emblem for an arcade game (home tiles and unlock celebration).

Link copied to clipboard
fun BoardCanvas(board: Board, roundKey: Int, win: WinLine?, look: MarkLook, threats: Map<Mark, Set<Int>>?, heatmap: FloatArray?, enabled: Boolean, onCell: (Int) -> Unit, modifier: Modifier = Modifier)

The whole game board, drawn on one Canvas. roundKey resets every animation when a new round starts, so the grid re-draws itself and marks animate in from scratch.

Link copied to clipboard
fun DrawScope.drawAvatarFrame(c: Offset, r: Float, accent: Color, glow: Float)

Ornate avatar frame: gold ring, bead studs and an optional pulsing turn glow.

Link copied to clipboard
fun DrawScope.drawBlock(topLeft: Offset, cell: Float, color: Color, alpha: Float = 1.0f, glow: Boolean = true)

A glossy block: glow, gradient face and a top sheen.

Link copied to clipboard
Link copied to clipboard
fun DrawScope.drawDie(c: Offset, s: Float, value: Int, tumble: Float = 0.0f)

A die face with pips; tumble (degrees) tilts it while it rolls.

Link copied to clipboard
Link copied to clipboard
fun DrawScope.drawGlyph(glyph: Glyph, color: Color)
Link copied to clipboard
fun DrawScope.drawMark(mark: Mark, style: MarkStyle, seed: Int, center: Offset, cell: Float, color: Color, strokeFraction: Float, progress: Float, pop: Float = 1.0f, alpha: Float = 1.0f, darkBackground: Boolean = true)

Draws a mark centred at center, cell pixels wide, progress of the way through its stroke animation, with pop as the bouncy scale factor.

Link copied to clipboard
fun DrawScope.drawMedal(medal: Medal, earned: Boolean, shine: Float)
Link copied to clipboard
fun DrawScope.drawPawn(at: Offset, cell: Float, color: LudoColor, lift: Float = 0.0f, glow: Float = 0.0f)

A glossy pawn with a soft shadow; lift (0..1) raises it off the board mid-hop.

Link copied to clipboard
fun GlyphIcon(glyph: Glyph, color: Color, modifier: Modifier = Modifier, size: Dp = 22.dp)

Every icon in the app is a few strokes on a Canvas — no vector or bitmap assets.

Link copied to clipboard
fun hexPath(center: Offset, radius: Float): Path

Pointy-top hexagon path.

Link copied to clipboard

Draws the static board (frame, parchment, track, lanes, rosettes). Cached — it only redraws on resize.

Link copied to clipboard
fun MedalArt(medal: Medal, earned: Boolean, modifier: Modifier = Modifier)

A medal drawn entirely on Canvas: ribbon, rimmed disc, emblem and a sweeping shine. Locked medals render as a dim, dashed silhouette.

Link copied to clipboard
fun PalaceBackdrop(modifier: Modifier = Modifier)

A golden palace at dusk, painted procedurally: sky, dunes, walls with arches, domes, minarets and palms. The scene is cached; only the drifting dust sparkles animate.

Link copied to clipboard

Light and dark tone for each medal.