Darkwaar27

Pigment

Rotation, Color Algebra & Deterministic Puzzles

One die. Six faces. Twenty-five cells.

darkwoodcom.itch.io/darkwaar27

Darkwood @matyo91

One die, one rule

Movement determines
the pigment.

Tip onto a neighbor. Rotate 90°. The down face stains the cell.

Tip East — yellow lands.

east tip
02 | tip @matyo91

The six faces

Orientation is the resource.

Initial orientation. Tip any direction.

Null ↔ Black Red ↔ Blue Yellow ↔ White

Opposites stay fixed. Every tip is a permutation of six slots.

roll east
03 | faces @matyo91

Rotation is a permutation

No physics. Just a table.

East → D ← E · U ← W · E ← U · W ← D

North and South unchanged.

"E":
    return {"D": e, "U": w, "N": n, "S": s, "E": u, "W": d}

The next state is computed, then drawn.

04 | permutation @matyo91

Color algebra

next_stain = mix(existing, face)

Yellow + Blue → Green

G
Orange Purple Green
rb
yb
white
black
null
05 | mix @matyo91

The state transition

Accept, or spend nothing.

Input→ Validate→ Roll→ Mix→ Update→ Victory?
if not _floor(current, to):
    return {state, events: {accepted: false}}
# roll → mix → spent += 1 → phase

Off-board tips are refused without consuming a turn.

pipeline
validate
roll
mix
update
victory
06 | apply @matyo91

More than pathfinding

Same position ≠ same state.

State = Position × Orientation × Pigments × Moves

Path A · E S W N E

Path B · E S E N W

Two greens. Different leftovers. Different die facing.

end
07 | state @matyo91

Level 2 · Return

Solving Green

Start (0,0). Mark Green at (1,0). Limit 5.

E → S → W → N → E

0 | 5 · Start at (0,0).

Yellow + Blue = Green

1
2
3
4
5
08 | green @matyo91

Levels 2 → 3

A solution is the whole board.

E S W N E · wins L3

Green at (1,0) · Yellow at (0,0)

E S E N W · fails L3

Green yes · start not yellow

Both green level 2. Only one preserves the start.

09 | leave @matyo91

Five levels, five constraints

Same machine. Steeper asks.

1 · First Face
Paint
2 · Return
Mix
3 · Leave
Preserve
4 · Other Pair
Combine
5 · White
Clear

Purple lives in the mix table — unused by these five boards.

10 | levels @matyo91

Small Godot architecture

Rules first. Scene second.

rules.gd

Deterministic transitions: roll, mix, apply, levels, replay checks.

main.gd

Input, drawing, tween, undo history. Projects state — never invents faces.

main.tscn

One Control. No ECS, no physics bodies, no large framework.

Small games benefit from small architectures.

11 | architecture @matyo91

Rendering the rules

Feedback is comprehension.

Pseudo-3D die Face glyphs Pigment tween Target rings Roll arc Orientation compass

If facing is unreadable, the mix feels arbitrary. Animation that names a rule is interface, not decoration.

12 | view @matyo91

Determinism & undo

S₀ → S₁ → S₂
then S₂ → S₁

Snapshot before accept. Deterministic transition. Known-solution replay.

S₀ · tip East, then Undo.

Deterministic — not purely functional.

tip
undo
13 | undo @matyo91

Engineering lessons

What the model implies

  • Orientation is a resource.
  • Movement modifies future actions.
  • Small transition tables create complex decisions.
  • Deterministic systems replay and debug cleanly.
  • Animation should expose rules.
  • Small games benefit from small architectures.
1
2
3
4
5
6
14 | lessons @matyo91

Play Pigment

One die.
Six faces.
Twenty-five cells.

Tip carefully. Leave the board you meant.

Darkwood · Darkwaar27 @matyo91