Breakout is an arcade ball-and-paddle game built with Phaser 4, TypeScript, Vite, and Tauri 2. It targets both the browser and desktop builds for Windows, macOS, and Linux.
The player controls a paddle at the bottom of the playfield, keeps the ball in play, and clears brick rows for points. The current implementation includes core Breakout gameplay, scoring, lives, a HUD, game-over flow, and platform-backed high score persistence.
- Phaser 4 for game rendering and arcade physics
- TypeScript for game code
- Vite for browser development and builds
- Tauri 2 for desktop development and packaging
- Vitest for unit tests
src/
scenes/ Phaser scene objects
entities/ Ball, paddle, brick grid, and other game objects
systems/ Shared game state, platform, debug, and event bus logic
config/ Asset keys, scene keys, events, balance values, and Tauri commands
test/ Test mocks and helpers
public/ Static browser assets
src-tauri/ Tauri desktop wrapper and Rust entrypoints
- Node.js and npm
- Rust stable toolchain, required only for Tauri desktop commands
Install dependencies:
npm installStart the Vite dev server:
npm run devVite prints the local URL when the server starts, typically http://localhost:5173.
Build the browser version:
npm run buildPreview the production build:
npm run previewStart the Tauri development app:
npm run tauri:devBuild desktop installers:
npm run tauri:buildTauri commands require the Rust toolchain and any system dependencies required by Tauri for your operating system.
Type-check the project:
npm run typecheckRun the test suite:
npm run testRun tests in watch mode:
npm run test:watchGenerate a coverage report:
npm run test:coverage- This project uses Phaser 4 modular imports, not the Phaser 3 global or monolithic import style.
- Scenes are functional scene objects in
src/scenes/, not class-basedPhaser.Scenesubclasses. - Game code in
src/should be TypeScript. - Shared constants belong in
src/config/. - Platform-specific behavior should go through
src/systems/Platform.ts. - Avoid changing
src-tauri/unless the task specifically requires native desktop behavior.