Flappybird Game - Holiday Shipping Spree Challenge

What happens when you try to build a game in Retool? You discover limitations, pivot multiple times, and end up with a hybrid architecture that somehow works.

gameplay

The Challenge

To build a fully playable Flappy Bird game for the Retool challenge while pushing Retool to its limits.

Spoiler: I found those limits. Then I found creative ways around them.

The Journey: Three Failed Attempts

Attempt #1: Retool's HTML Component

The Plan: Build the entire game in Retool's HTML component with inline JavaScript.

The Reality: Retool strips JavaScript from HTML components for security. The game rendered beautifully but was completely non-interactive. Canvas appeared, bird appeared, nothing happened.

Attempt #2: postMessage Communication

The Plan: Run game in iframe, use postMessage to send scores to parent Retool app, have a JavaScript query listen with window.addEventListener.

The Reality: Retool's JavaScript queries don't have access to window or addEventListener. The game sent messages into the void. Nobody was listening.

Attempt #3: The Webhook Solution (Success!)

The Plan: Deploy game to GitHub Pages, call a Retool Workflow webhook directly via fetch().

The Architecture

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚   GitHub Pages (Game)       β”‚
β”‚   - Full Canvas game        β”‚
β”‚   - Generated with Claude   β”‚
β”‚   - 60 FPS gameplay         β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
           β”‚
           β”‚ HTTP POST (score data)
           β–Ό
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚   Retool Workflow           β”‚
β”‚   - Accept POST request     β”‚
β”‚   - Insert to database      β”‚
β”‚   - Return success response β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
           β”‚
           β–Ό
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚   Retool Database           β”‚
β”‚   - scores table            β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
           β”‚
           β–Ό
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚   Retool App (Dashboard)    β”‚
β”‚   - IFrame (game display)   β”‚
β”‚   - Live leaderboard        β”‚
β”‚   - Score analytics chart   β”‚
β”‚   - Auto-refresh every 5s   β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

Why This Works

The Game (GitHub Pages):

  • Generated with Claude - full Canvas implementation with physics engine and collision detection

  • Zero Retool limitations - full browser API access, smooth 60 FPS

  • Deployed once, loads fast everywhere

  • Source (GitHub)

The Webhook (Retool Workflow):

  • CORS-enabled endpoint the iframe can call directly

  • Three-step flow: parse input β†’ insert to DB β†’ respond with success

  • No postMessage gymnastics needed

The Dashboard (Retool App):

  • IFrame component displays the game

  • Leaderboard table auto-refreshes every 5 seconds

  • Score distribution chart with dynamic bucketing

  • Top 3 ranks get star emojis (:star:1, :star:2, :star:3)

What I Learned

Retool's Limitations:

  1. HTML components strip <script> tags completely

  2. JavaScript queries can't access window or attach persistent event listeners

  3. IFrame postMessage reception is impossible in JS queries

The Pivot:

  • Stop fighting Retool's security model

  • Use external hosting for complex client-side logic

  • Webhooks are Retool's superpower for external integration

  • Hybrid architecture: right tool for each job

Retool Assist helped me navigate from failed attempts to the working solution, even as we discovered platform’s constraints together. The final architecture uses each tool for what it does best.

Try it yourself: Play the game, submit your score, watch it appear on the leaderboard in real-time. It's silly, it's festive, and it proves you can build almost anything when you stop asking "Can Retool do this?" and start asking "How can I make Retool do this?"

:christmas_tree::bird: Play now and join the leaderboard :christmas_tree::bird:

https://sionkim001.retool.com/embedded/public/1677bee9-f966-4a7f-9c21-c663c4c374b0

5 Likes

So very cool! I challenge anyone to beat my score!

3 Likes

Thanks for sharing, @skim-rgare! I forgot how difficult Flappybird can be. :sweat_smile: If you ever want to revisit this, I'd recommend exploring custom components as a native solution for embedding dynamic content within Retool.

The approach that you came up with is really clever, but it does expose your backend workflow to potential shenaniganery.