A comprehensive collection of tools and utilities for game development with Phaser.
This monorepo contains a cohesive suite of TypeScript-first libraries for Phaser. Each package is focused, well-tested, and built to work great together or stand alone.
Hudini is a collection of reusable, themeable UI components for Phaser games. Named after the famous magician Houdini and HUD (Head-Up Display), it provides a magical toolkit for building consistent game interfaces.
Key Features:
- ๐จ Themeable - Dark/light themes with full customization
- ๐ฆ Phaser-wind Dependency - Only requires phaser-wind
- ๐ฏ TypeScript First - Full type safety and IntelliSense
- ๐งช Tested - Comprehensive test coverage
Components:
Column- Stacks children vertically with spacing and alignmentRow- Arranges children horizontally with spacing and alignmentIconButton- Interactive circular icon button with animationsFlatIconButton- Flat-style icon button with customizable colors and opacity
Links:
- ๐ฆ NPM Package
- ๐ Documentation
- ๐ฎ Live Demos
Phaser Wind brings the joy and simplicity of Tailwind-like design tokens to Phaser games! Stop fighting with magic numbers and random colors.
Key Features:
- ๐จ Complete Tailwind-like Color Palette - 22 families ร 11 shades
- ๐ Semantic Font Sizes - From
xsto6xl - ๐งฉ Default constants ready-to-use -
Color,FontSize,Spacing,Radius,Shadow - ๐งญ Optional theme system (typed) - Add your own tokens with strong typing
- ๐ง TypeScript First - Full type safety and IntelliSense
- ๐ฎ Phaser Ready - Global plugin for easy access in scenes
Example:
import { Color, FontSize } from 'phaser-wind';
const button = this.add.text(100, 50, 'Click me!', {
fontSize: FontSize.css('lg'), // Clear intention!
fill: Color.rgb('blue-500'), // Beautiful blue
backgroundColor: Color.rgb('gray-800'), // Perfect contrast
});Links:
- ๐ฆ NPM Package
- ๐ Documentation
- ๐ฎ Live Demos
Use Font Awesome icons as text/sprites directly in your Phaser scenes with zero friction rendering pipeline.
Key Features:
- ๐ฏ Zero friction rendering - Direct integration with Phaser text system
- ๐จ Full control - Sizing, color and stroke controls
- ๐ฆ IconText component - Ready-to-use component for icons
- ๐ง TypeScript Support - Full type safety
Example:
import { IconText } from 'font-awesome-for-phaser';
const icon = new IconText(this, 90, 90, 'gamepad', 64, {
color: '#0066cc',
iconStyle: 'solid', // 'solid' | 'regular' | 'brands'
});Links:
- ๐ฆ NPM Package
- ๐ Documentation
- ๐ฎ Live Demos
A comprehensive state management library for Phaser games with React-like hooks pattern. Reduce boilerplate and manage state cleanly.
Key Features:
- ๐ฏ React-like API - Familiar hooks pattern for Phaser developers
- ๐ Type-safe - Full TypeScript support with compile-time validation
- ๐ฎ Phaser-native - Designed specifically for Phaser lifecycles
- ๐งช Well-tested - Comprehensive test coverage
- ๐ Debug Mode - Built-in debug logging for development
Available Hooks:
withLocalState- Scene-specific state managementwithGlobalState- Application-wide statewithPersistentState- State with localStorage persistencewithComputedState- Derived state that auto-updateswithUndoableState- State with undo/redo functionalitywithDebouncedState- State with debounced updates
Example:
import { withLocalState } from 'phaser-hooks';
const playerState = withLocalState<{ hp: number; level: number }>(
this,
'player',
{ hp: 100, level: 1 },
{ debug: true } // Enable debug logging
);
playerState.set({ hp: 90, level: 2 });
const currentPlayer = playerState.get();Links:
- ๐ฆ NPM Package
- ๐ Documentation
- ๐ฎ Live Demos
The ultimate type-safe audio management system for Phaser.js games. Transform your game's audio experience with professional-grade sound management, multi-channel mixing, and automatic volume persistence.
Key Features:
- โ Full TypeScript Support - Complete type safety for sound keys and channels
- ๐๏ธ Multi-Channel Audio - Professional mixing with HUD, SFX, Music, and custom channels
- ๐พ Automatic Persistence - Player volume preferences saved automatically
- โก Smart Preloading - Efficient audio loading with lazy loading fallbacks
- ๐ฏ Zero Configuration - Works out of the box with sensible defaults
- ๐ Phaser Hooks Integration - Leverages battle-tested state management
Example:
import { getSoundStudio } from 'phaser-sound-studio';
const studio = getSoundStudio<GameSounds, GameChannels>(this);
studio.play('button-click'); // โ
Type-safe!
studio.setChannelVolume(this, 'music', 0.1); // Lower background musicLinks:
- ๐ฆ NPM Package
- ๐ Documentation
- ๐ฎ Showcase Games
- Node.js >= 18.0.0
- pnpm >= 8.0.0
# Clone o repositรณrio
git clone https://github.com/cassinodev/phaser-toolkit.git
cd phaser-toolkit
# Instale as dependรชncias
pnpm install
# Construa todos os pacotes
pnpm buildpnpm build- Builds all packagespnpm test- Runs tests across all packagespnpm dev- Starts development modepnpm lint- Runs linting across all packagespnpm typecheck- Checks TypeScript typespnpm clean- Cleans previous buildspnpm changeset- Creates a new changeset for versioningpnpm release- Publishes new versions of packages
phaser-toolkit/
โโโ packages/
โ โโโ hudini/ # UI components
โ โโโ phaser-wind/ # Design tokens & theming
โ โโโ font-awesome-for-phaser/ # Font Awesome icons
โ โโโ phaser-hooks/ # State management hooks
โ โโโ phaser-sound-studio/ # Audio management
โ โโโ phaser-toolkit-demo/ # Storybook demos
โโโ package.json
โโโ pnpm-workspace.yaml
โโโ README.md
Contributions are always welcome! Please read our contribution guide before submitting a PR.
- Fork the project
- Create a branch for your feature (
git checkout -b feature/AmazingFeature) - Commit your changes (
git commit -m 'Add some AmazingFeature') - Push to the branch (
git push origin feature/AmazingFeature) - Open a Pull Request
This project is licensed under the MIT License - see the LICENSE file for details.
CassinoDev
- Website: games.cassino.dev
- GitHub: @cassinodev
If this project helped you, please give it a โญ in the repository!