Inspiration

We wanted to take the insanely addictive "just one more try" feeling of classic physics puzzle games and inject it with the viral, community-driven DNA of Reddit.

Reddit isn't just a place to consume content; it’s a place to create and share it. We realized that if we could build a flawless physics engine in Phaser 4 and pair it with Devvit's Native Posts, we could turn a subreddit into a living, breathing Arcade where the players are also the level designers. Thus, Spy Shot was born—a game designed not just to be played, but to be shared, speedrun, and discussed daily.

What it does

Spy Shot is a fully-featured, physics shooter built natively for the Reddit feed. It features three distinct modes engineered for maximum retention and community engagement:

  • ♾️ Endless Run (The Grind): A procedurally generated endless campaign. Players earn coins by clearing waves and must strategically spend them to buy emergency bullets. We fixed the "rich get richer" problem by scaling bullet prices exponentially, forcing players to rely on skill, not just hoarded wealth to climb on top of Leaderboard.
  • 📅 Daily Bounty: A highly competitive 5-wave speedrun. Every player on Reddit gets the exact same layout every 24 hours. You cannot buy extra bullets here. Players compete for the fastest time to win a massive 500 Coin payout and to climb on top of Leaderboard—but once you clear it, you are locked out until tomorrow, building a powerful daily habit.
  • 🛠️ Level Editor: A fully functional drag-and-drop level editor. Players place Agents, Enemies, and TNT, then hit "Publish". Using Devvit's API, the game literally generates a brand-new Reddit post in the subreddit containing their custom puzzle! Every custom level has its own isolated, mathematically weighted Leaderboard based on Ammo Efficiency and Speed.

How we built it

We built SpyShot using Devvit Web, bridging a robust Phaser 4 frontend with a Hono / Redis backend.

  • The Engine: Phaser powers the Arcade Physics (bullet ricochets, TNT chain-reaction radius checks), Canvas API generation (rendering buttery-smooth vector gradient skies), Raycasting math (the trajectory preview line), and complex Tweening (gun recoil, camera shake, agent breathing).
  • The Backend: We utilized Devvit's Redis implementation extensively. We used standard key-values for the economy, but relied heavily on Sorted Sets (zSets) for the leaderboards, combining (Bullets Left * 10,000,000) - TimeTakenMs into a single Master Score so Redis natively ranks players by Ammo Efficiency first, and Speed second!
  • Devvit Journeys: We implemented the experimental Devvit Journeys SDK to track client-side telemetry. We track App.Ready, Journey.Start, Journey.Progress (wave clears), stateless interactions (buying bullets, toggling mute), and Journey.End (wins/deaths) to gather real-time data on player friction points.

Challenges we ran into

  • The Sandbox Web-View: Browsers aggressively sandbox iFrames. We had to carefully manage AudioContext restrictions and construct native HTML <a> tags and requestExpandedMode() calls so the game would seamlessly transition from a lightweight inline splash screen to a full-screen, audio-enabled immersive experience without crashing.
  • Kamikaze Edge-Cases: In physics games, race conditions are everywhere. We had to write complex state-guards to handle situations where a player shoots a TNT crate, killing the last enemy, but also blowing themselves up in the process (mutually assured destruction!), ensuring the UI and database resolved the exact sequence of events without duplicating popups.
  • Procedural Soft-Locks: Pure randomness creates unbeatable levels. We had to write "Smart Rules" into the generator so it knew when a player was spawning on a high sniper-pillar, and actively prevented enemies from spawning inside enclosed bunkers on the same wave.

Accomplishments that we're proud of

  • Zero-Asset Textures: Aside from the core character sprites, 90% of the game's visuals (skies, crates, platforms, TNT, particles, UI boxes) are mathematically drawn at runtime using the Canvas API, keeping the bundle size incredibly small and razor-sharp on high-DPI mobile screens.
  • Flawless UGC Integration: We successfully turned Reddit posts into game cartridges. Seeing a user click "Publish" in the Phaser canvas and watching a real Reddit post instantly appear in the feed with its own isolated database state is magical.

What we learned

We learned how to deeply integrate web technologies with Reddit's backend infrastructure. We mastered Phaser's object pooling and Arcade physics, and discovered incredibly clever ways to bypass browser caching (?t=Date.now()) to ensure the Reddit UI always displays real-time leaderboard data.

What's next for Spy Shot

We plan to introduce Cosmetics. Players will be able to spend their hard-earned Endless Mode coins to unlock custom bullet trails (Rainbow, Matrix code), new Agent outfits, and unique gun sounds, giving them the ultimate bragging rights when they hit Rank #1 on the Daily Bounty!

Built With

Share this project:

Updates

Submission history