Prism Beam

Inspiration

Prism Beam was inspired by a desire to bring true, mind-bending spatial reasoning to the Reddit community. Many casual platform games rely on quick reflexes or mindless click loops, but we wanted to build a slow-burn challenge that forces users to pause, plan, and analyze. By blending classic laser maze geometry with an evolving psychological narrative, the goal was to create a gameplay loop that naturally prompts community discussion, theory-crafting, and collaborative puzzle-solving in the comments.


What it does

Prism Beam is a 2D puzzle game embedded directly within a Reddit post. Players are presented with a grid system \( G \) of size \( M \times N \) containing a light emitter, targeted gems, and complex wall layouts.

Instead of just blindly turning pre-placed mirrors, players are handed a limited tray of pieces. They must physically analyze the grid to deduce the perfect path, tapping to place, rotate, or pull back mirrors to snake the light beam through every objective. It features a high-stakes Daily Puzzle mode that ties into collective community progression, alongside a Practice/Archive Mode for endless replayability.

Core Gameplay Objectives:

  • [x] Path Optimization: Guide the beam from emitter to all targets.

  • [x] Zero Waste: Utilize exactly the allotted mirror count in your tray.

  • [ ] Community Conquest: Collaborate on daily puzzles to unlock story archives.


How we built it

The game leverages a powerful, hybrid architecture built on top of Reddit’s Devvit platform. We paired React with Phaser 3 to achieve the ultimate stack—React handles the UI overlays, menus, dynamic puzzle archives, and state management smoothly, while Phaser drives the canvas rendering, light physics, and mirror manipulation. The backend uses Devvit's integrated Redis database configuration to maintain globally synchronized daily puzzles, keeping tracking lightweight and optimized.

Vector Reflection Physics

To handle the light physics dynamically across the 2D grid, we implemented standard vector reflection mechanics. For an incoming light direction vector \( \vec{d} \) hitting a mirror surface with normal vector \( \vec{n} \), the reflected direction vector \( \vec{r} \) is calculated using the following equation:

$$

\vec{r} = \vec{d} - 2(\vec{d} \cdot \vec{n})\vec{n}

$$

Because our mirrors are locked to 45-degree angles (represented as diagonal lines \( y = x \) or \( y = -x \) relative to the local grid system), the reflection transforms simply map cardinal directions (e.g., \( [0, 1] \rightarrow [1, 0] \)), ensuring lag-free calculations on mobile devices.


Challenges we ran into

One of the massive structural hurdles we faced during playtesting was the "greedy-solvable" problem. Early versions allowed users to brute-force levels simply by rotating mirrors that were already sitting in the right slots, which ruined the difficulty.

Pivoting late in the sprint to a full "tray-placement" mechanic—requiring from-scratch planning and spatial deduction—was mechanically intensive but completely saved the experience.

The Solvability State Table

We had to track the grid state dynamically to ensure every generated level was mathematically solvable but challenging:

| Grid Variable | State Representation | Description |

| :--- | :--- | :--- |

| \( E_{(x,y)} \) | [Start_X, Start_Y] | Origin point of the laser source. |

| \( T_k \) | Array<[X, Y]> | Target coordinates of gems \( k \in {1, \dots, n} \). |

| \( M_{\text{tray}} \) | Integer | Total number of mirrors allowed to be placed. |

We also navigated strict CLI constraints regarding app-slug migrations, ensuring server assets mapped perfectly without overwriting our core engine.


Accomplishments that we're proud of

We are incredibly proud of how smoothly Phaser and React work together in a webview context. Achieving zero-latency canvas updates alongside responsive, component-driven UI menus feels exceptionally polished. Turning a casual concept into a genuine brain teaser that guarantees high-contrast, atmospheric visual presentation is a major win.


What we learned

Building for Reddit requires shifting your mindset from individual player experiences to aggregate community experiences. We learned how to carefully scope an MVP under tight timelines, realizing that keeping an architecture clean and modular is vastly more important than cramming in unpolished secondary features.


What's next for Prism Beam

The foundation is perfectly positioned for expansion. Next on the radar is deepening the social integration:

  1. Asymmetric Community Hooks: Letting players comment with custom string seeds to generate user-made puzzles for others to try.

  2. Meta-Progression: Adding deeper progression mechanics like reward drops and a psychological storytelling log.

Share this project:

Updates

Submission history