Dragonhearted Labs All work

Case study

GenFlappy

A Flappy Bird game where you describe the character, the obstacle and the background in plain words, and AI generates the sprites you then play with.

Play GenFlappy (opens in a new tab)
GenFlappy’s first screen: a form titled “Customize your Flappy Bird game with AI”, with three fields for the character, the obstacle and the background, and buttons to pick at random or start the game

What it is

GenFlappy is a portfolio piece about putting generative AI inside a game. It is built on Robert Kratz’s open-source Flappy Bird, which supplies the mechanics, physics, audio and canvas rendering.

GenFlappy adds the AI layer: the sentence you fill in, the sprite generation behind it, and the caching and fallbacks around it.

How it works

You complete one sentence, naming a character, an obstacle and a background, and the game asks for a sprite for each. The requests go to serverless functions on Vercel that call the image model through Replicate, so no API key reaches the browser.

The model is FLUX-Schnell. SDXL was tried first and dropped because its content filter blocked harmless game prompts such as “volcano” and “ninja”, so speed was traded for predictability.

Character and obstacle sprites have their backgrounds removed with remove.bg, and every generated asset is checked for grayscale, size and transparent edges before it is cached. The cache lives in the browser and matches near-identical prompts, so a plural or a typo reuses an earlier sprite instead of generating a new one. When generation fails, the game falls back to its built-in demo assets instead of breaking.

Screens

Stack

Added in GenFlappy

  • Vercel serverless functions
  • Replicate
  • FLUX-Schnell
  • remove.bg
  • IndexedDB
  • Sentry

From the base game

  • React
  • TypeScript
  • Vite
  • Tailwind CSS
  • Canvas
  • Howler.js

Links