npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

flappy-gouda-game

v0.5.0

Published

A drop-in canvas-based Flappy Bird game component for React 18+

Readme

flappy-gouda-game

npm GitHub Storybook CI License: MIT Bundle Size

A drop-in canvas-based Flappy Bird game component for React 18+. 60fps rendering, 3 difficulty levels, customizable theme, optional leaderboard, and full TypeScript support.

Live Demo · Storybook

Installation

npm install flappy-gouda-game
# or
pnpm add flappy-gouda-game
# or
yarn add flappy-gouda-game

Peer dependencies: react >= 18 and react-dom >= 18.

Basic Usage

import { FlappyGoudaGame } from 'flappy-gouda-game';

function App() {
  return <FlappyGoudaGame />;
}

That's it. The component renders a self-contained canvas game with title screen, score tracking, difficulty picker, and game-over screen.

Props Reference

| Prop | Type | Default | Description | |---|---|---|---| | colors | Partial<GameColors> | Built-in theme | Custom color overrides for the game canvas | | bannerTexts | string[] | Built-in texts | Custom texts displayed on animated flying planes | | fontFamily | string | "sans-serif" | Font family for canvas-rendered text | | difficulty | DifficultyKey | "normal" | Initial difficulty ("easy", "normal", "hard") | | onStateChange | (state: GameState) => void | — | Called on state transitions (idleplaydeadpaused) | | onScoreChange | (score: number) => void | — | Called when the player scores | | onBestScoreChange | (scores: BestScores) => void | — | Called when a new personal best is set | | onDifficultyChange | (difficulty: DifficultyKey) => void | — | Called when difficulty changes | | className | string | — | CSS class applied to the outer container | | showFps | boolean | false | Show the FPS counter overlay | | showDebug | boolean | false | Show the debug analytics panel | | onDebugMetrics | (metrics: DebugMetricsSnapshot) => void | — | Debug metrics callback (~8 times/sec) | | debugControlsRef | { current: DebugControls \| null } | — | Ref for recording controls | | leaderboard | LeaderboardData | — | Leaderboard data to display (see Leaderboard section) | | leaderboardCallbacks | LeaderboardCallbacks | — | Callbacks for score submission and nickname flow | | nickname | string \| null | — | Player's nickname. null triggers the nickname modal | | leaderboardExpanded | boolean | false | Hides in-game mini overlay when external panel is open |

Theming

Pass a partial GameColors object to override the default palette:

<FlappyGoudaGame
  colors={{
    navy: '#1a1a2e',
    violet: '#e94560',
    cyan: '#0f3460',
    magenta: '#ff6b6b',
    light: '#f8f9fa',
    white: '#ffffff',
    midviolet: '#7c3aed',
    skyBottom: '#dbeafe',
  }}
/>

Leaderboard

The game supports optional leaderboard integration. You provide the data and callbacks; the game handles the UI.

import { FlappyGoudaGame, useNickname } from 'flappy-gouda-game';

function App() {
  const { nickname, setNickname } = useNickname();

  return (
    <FlappyGoudaGame
      nickname={nickname}
      leaderboard={{
        entries: [...],
        playerEntry: null,
        isLoading: false,
        connectionStatus: 'connected',
      }}
      leaderboardCallbacks={{
        onScoreSubmit: (score, difficulty) => { /* submit to your backend */ },
        onNicknameSet: (name) => setNickname(name),
        onNicknameCheck: async (name) => ({ available: true }),
      }}
    />
  );
}

Design Tokens

Exported design token constants for consistent styling outside the game canvas:

import {
  DESIGN_TOKENS,
  COLOR_TOKENS,
  FONT_FAMILY,
  FONT_SIZE,
  SPACING,
  RADIUS,
  SHADOW,
  Z_INDEX,
  cssVar,
} from 'flappy-gouda-game';

// Use tokens in your own components
const style = { fontFamily: FONT_FAMILY.heading, padding: SPACING.md };

// Generate CSS custom property names
const varName = cssVar('color-navy'); // '--sn-color-navy'

Exported Types

import type {
  FlappyGoudaGameProps,
  GameState,            // 'idle' | 'play' | 'dead' | 'paused'
  DifficultyKey,        // 'easy' | 'normal' | 'hard'
  BestScores,           // Record<DifficultyKey, number>
  GameColors,           // Theme color palette
  LeaderboardData,      // Leaderboard state
  LeaderboardCallbacks, // Leaderboard action handlers
  LeaderboardEntry,     // Single leaderboard row
  DebugMetricsSnapshot, // Debug panel metrics
  DebugControls,        // Recording control interface
  DebugRecording,       // Recorded frame data
} from 'flappy-gouda-game';

Browser Support

Requires a browser with Canvas 2D support (all modern browsers). Works with React 18 and React 19.

License

MIT