DEV Community

Cover image for Turing’s Solstice by Yousun — An AI-Powered Puzzle Game Where Every Hint Costs Light
Yousun Lotif (Bappy Khan)
Yousun Lotif (Bappy Khan)

Posted on

Turing’s Solstice by Yousun — An AI-Powered Puzzle Game Where Every Hint Costs Light

June Solstice Game Jam Submission

This is a submission for the June Solstice Game Jam

Turing’s Solstice by Yousun

Decode the Last Light.

What if asking for help could bring you closer to losing?

Turing’s Solstice is a cinematic browser-based puzzle game inspired by the June Solstice, Alan Turing, code-breaking, and the fragile balance between daylight and darkness.

The player must solve six increasingly complex puzzles before the Daylight Meter reaches zero. Correct answers restore light, wrong answers strengthen the darkness, and every Gemini AI hint costs part of the player’s remaining daylight.

The result is a puzzle journey where logic is not the only challenge—resource management, risk, and timing matter too.


What I Built

I built a six-level code-breaking adventure where players restore a damaged solstice machine by recovering hidden fragments.

The journey includes:

  1. Solar Cipher — decode a Caesar-shifted message
  2. Binary Stream — translate binary into language
  3. Algorithm Fragment — recognize a mathematical pattern
  4. Mirror Solstice Cipher — reverse a shadow message
  5. Turing Decision Gate — solve a light-and-dark logic sequence
  6. Final Solstice Key — combine the recovered knowledge into the final machine key

Every solved level unlocks:

  • A recovered machine fragment
  • A Turing-inspired note
  • A daylight reward
  • A cinematic transition into the next challenge

The intended experience is short, focused, replayable, and atmospheric—something that feels more like entering a mysterious decoding machine than completing a normal web form.


How It Connects to the June Solstice

The June Solstice represents the longest day and the relationship between light and darkness.

I turned that theme into the core gameplay system.

The Daylight Meter acts as both energy and survival time:

  • Correct answer: +10% daylight
  • Wrong answer: -12% daylight
  • Gemini hint: -8% daylight
  • Daylight reaches zero: the machine loses balance

This means the solstice theme is not only visual decoration. It directly controls how the player thinks, takes risks, and progresses.

The golden side of the interface represents daylight, while the blue side represents night, computation, and uncertainty.


Video Demo

Direct video link:

https://youtu.be/QtAMMGERbeQ

The demo shows:

  • The home and project story pages
  • The cinematic level-intro system
  • Puzzle solving
  • Daylight loss and recovery
  • Gemini-powered hints
  • Adaptive Oracle modes
  • Fragment recovery animations
  • Sound and visual feedback
  • The final restoration sequence

Live Demo

Play Turing’s Solstice by Yousun here:

https://turing-s-solstice-by-yousun.vercel.app/


Code

GitHub repository:

https://github.com/yousunlotif-bappy/Turing-s-Solstice-by-Yousun


How I Built It

The project was built with:

  • Next.js
  • React
  • TypeScript
  • Google Gemini API
  • CSS animations
  • Web Audio API
  • Vercel

I used the Next.js App Router to separate the experience into:

  • Landing page
  • Game page
  • Project story page
  • Server-side Gemini hint API route

The puzzle content is stored as structured TypeScript data. Each level contains its title, puzzle type, objective, answer, recovered fragment, success note, and Turing-inspired archive note.

This structure made it easy to expand the game from four levels to six without rewriting the main game engine.


Core Game State

React state controls the main gameplay systems:

  • Current level
  • Daylight percentage
  • Player answer
  • Wrong-attempt count
  • Number of hints used
  • Current Gemini hint
  • Adaptive hint mode
  • Recovered fragment
  • Unlocked Turing notes
  • Reward animation
  • Level-intro overlay
  • Win and lose states

Answers are normalized before comparison, so reasonable variations are accepted.

For example, the final key can be entered with different capitalization, spacing, or separators without unfairly rejecting the player.


Google Gemini as the Solstice Oracle

Gemini is not used as a generic chatbot.

Inside the game, Gemini becomes the Solstice Oracle—an adaptive in-world guide that helps the player without directly revealing puzzle answers.

Every hint request sends gameplay context to the server:

  • Current level
  • Puzzle type
  • Puzzle text
  • Remaining daylight
  • Wrong-attempt count
  • Number of hints already used

The Oracle then responds in one of three modes.

Cryptic Mode

Used when the player has high daylight and few mistakes.

The hint remains mysterious and indirect.

Balanced Mode

Used when the player has made a mistake or daylight has started falling.

The hint becomes more practical while still requiring thought.

Urgent Mode

Used when daylight is low or the player has made multiple mistakes.

The hint becomes clearer, but the Oracle is still instructed never to reveal the final answer.

This creates an AI system that responds to the player’s situation instead of returning the same type of hint every time.

Most importantly, every request costs daylight.

The player must decide:

Should I preserve the remaining light and solve the puzzle myself, or sacrifice daylight for guidance?

That decision makes Gemini part of the game’s strategy, tension, and economy.


Reliable Fallback System

The game also includes level-specific fallback hints.

If the Gemini API key is unavailable, the request fails, or the model returns no usable text, the game still provides a safe hint instead of breaking.

This keeps the project playable in local, preview, and production environments.

The Gemini API key remains server-side through environment variables and is never exposed in client-side code.


Fragment Recovery System

Correct answers do more than move the player to the next level.

Each success triggers a reward moment:

FRAGMENT RECOVERED

DAYLIGHT RESTORED +10%

TURING NOTE UNLOCKED

MACHINE STABILITY IMPROVED

This gives every solved puzzle a visible narrative purpose.

The player is not simply answering questions—they are rebuilding the solstice machine one fragment at a time.


Alan Turing Inspiration

Alan Turing’s legacy shaped the entire puzzle journey.

The game explores:

  • Caesar ciphers
  • Binary communication
  • Pattern recognition
  • Algorithms
  • Logical state decisions
  • Code-breaking
  • Machine-like reasoning

Each completed puzzle unlocks a short Turing Note connected to computation, logic, or decoding.

These notes turn progression into a small learning and storytelling system rather than a simple level counter.


Sound and Micro-Animations

I used the browser’s Web Audio API to generate lightweight sound effects without downloading external audio assets.

The game includes:

  • A rising light chime for correct answers
  • A low dark tone for wrong answers
  • A soft Oracle tone for Gemini hints
  • Golden feedback flashes
  • Red warning pulses
  • Blue Oracle glows
  • Decoder-wheel reactions
  • Reward sparkles
  • Button and input micro-interactions

The effects make the machine feel alive and responsive while avoiding copyrighted sound files.

The CSS also respects the user’s prefers-reduced-motion accessibility setting.


Design Direction

The visual identity is built around two opposing energies:

Daylight

  • Gold
  • Warm orange
  • Solar glow
  • Recovery
  • Hope

Night and Computation

  • Deep blue
  • Black glass panels
  • Binary patterns
  • Cold light
  • Uncertainty

The circular decoder wheel sits between both sides, representing the machine—and the player—trying to keep them in balance.


Challenges I Solved

Making AI part of gameplay

The biggest design challenge was avoiding a normal “click for help” button.

The daylight cost and adaptive modes turned Gemini into a meaningful strategic mechanic.

Protecting the API key

Gemini requests run through a Next.js server route. The key is stored in GEMINI_API_KEY and never sent to the browser.

Keeping transitions safe

Input and action buttons are disabled during level intros and fragment-recovery overlays, preventing duplicate submissions or accidental hint requests.

Flexible answer checking

The answer-normalization system removes formatting differences while keeping the intended solution intact.

Making a small game feel complete

Level intros, archive notes, fragments, sounds, risk tracking, and cinematic endings helped transform a small puzzle prototype into a complete journey.


Prize Category

Best Google AI Usage

Gemini is directly integrated into the game’s central risk-and-reward system.

The Oracle changes its hint style according to the player’s remaining daylight and mistake count. Because every request reduces daylight, AI assistance has an immediate gameplay consequence.

Gemini is therefore not an external helper—it is a dynamic mechanic inside the game.

Best Ode to Alan Turing

The project celebrates Alan Turing through code-breaking, binary systems, algorithms, logic gates, pattern recognition, and machine-inspired reasoning.

The unlockable Turing Notes connect every completed level to the ideas that helped shape modern computing.


What Makes Turing’s Solstice Different

The central idea is simple:

Help has a cost.

The player can ask an advanced AI for guidance, but doing so weakens the resource needed to survive.

Every system supports that idea:

  • Puzzles test reasoning
  • Daylight creates pressure
  • Wrong answers expand the darkness
  • Gemini offers strategic assistance
  • Fragments create narrative progression
  • Turing Notes reward curiosity
  • Sound and motion make the machine react

The project combines theme, gameplay, artificial intelligence, and presentation into one connected experience.


Final Thoughts

I began with the idea of a single solstice-themed cipher.

It grew into a six-level journey about light, logic, risk, and the process of learning how to decode a machine.

The final light does not return because the Oracle solves everything for the player.

It returns because the player learns when to ask for help—and when to trust their own reasoning.

The machine is waiting.

Can you decode the last light before darkness takes over?


Play the Game

https://turing-s-solstice-by-yousun.vercel.app/

Watch the Demo

https://youtu.be/QtAMMGERbeQ

Explore the Code

https://github.com/yousunlotif-bappy/Turing-s-Solstice-by-Yousun

Top comments (0)