DEV Community

Eliott
Eliott

Posted on

SOLSTICE, A shadow capture game in C

June Solstice Game Jam Submission

What I Built

A two-player terminal strategy game written in C. No libraries, no graphical engin, just ANSI colors and printf.

Two players place stones on a 9×9 grid. Each stone casts a shadow away from the sun. The shadow captures every cell it crosses, and can recapture enemy territory too. The catch: the sun moves to a new position every turn, constantly shifting shadow directions.

9 stones each, 18 turns. Most cells captured wins.

Video Demo

Code

SOLSTICE — Shadow Capture

A submission for the June Solstice Game Jam 2026


What I Built

SOLSTICE is a two-player terminal strategy game written in C. It runs entirely in the terminal with ASCII rendering and ANSI colors — no external libraries, no graphical engine, just pure C and a bit of sunlight.

The concept is simple: two players, a grid, and a sun that never stays still. Each turn, the sun moves to a new position along the border of the board. You place a stone, and that stone casts a shadow — a long streak of captured territory projected directly away from the sun. The longer the distance between your stone and the sun, the longer the shadow it casts. Place well, and a single stone can sweep across half the board in one move.

After 18 turns, the player who controls the most cells wins.


The Story

How I Built It

Pure C, split across 6 files (main.c, game.c, board.c, player.c, utils.c, game.h). Compile with make, run with ./solstice.

The shadow casting works by computing a direction vector from the sun through the stone, then casting a ray in that direction. The length equals the Chebyshev distance between the stone and the sun — farther sun, longer shadow, just like real life.

The sun follows a precomputed clockwise path around the board with a small random drift each turn, so it's predictable enough to strategize around but never perfectly calculable.

The whole game is basically a simulation of what makes the solstice visually striking — a sun that moves and shadows that follow. The 18-turn structure represents the days around June 21st, and the two-player tension mirrors the solstice duality: longest day for one hemisphere, shortest for the other.

Top comments (0)