Flappy-Bird in your terminal
Physics-driven flap game — the bird's vertical motion is a HoneyBounce projectile (gravity + an upward velocity kick on each tap), pipes scroll left at a fixed cell rate, collision is per-cell. Pure-state Game class; the renderer is a one-pass canvas fill.
composer require sugarcraft/honey-flap
./bin/honey-flap
// Programmatic:
use SugarCraft\Core\Program;
use SugarCraft\Core\ProgramOptions;
use SugarCraft\Flap\Game;
(new Program(Game::start(),
new ProgramOptions(useAltScreen: true)))->run();
Projectile with gravity vector. flap() rebuilds the projectile with an upward velocity kick — same trick the original flapioca uses, just expressed as projectile state.PIPE_EVERY ticks; the gap row is sampled from the injected PRNG so tests pin layouts deterministically.Cmd::tick(0.033, …) ≈ 30 fps. Each tick advances physics + scrolls pipes + checks collision.r reseeds the world; q / Esc quits.| Class | Method | Description |
|---|---|---|
| Game | start() | Initialize game state |
| Game | tick(delta) | Advance physics one step |
| Game | flap() | Apply upward velocity kick |
| Game | render() | Return ANSI frame string |
| Program | new(game, options) | Create program |
| Program | run() | Start the event loop |
| ProgramOptions | new(useAltScreen) | Configure terminal mode |
VHS-recorded GIFs of every example shipped with the app. Regenerated automatically on every push that touches the source.