Template·phaser·v1.0.0·MIT

Phaser Endless Runner

A complete Phaser endless-runner starter game in TypeScript with Vite.

#template#runner#phaser#starter

Install

npx create-gamecn my-game --template phaser-endless-runner

Source preview

Compatibility

Engines
phaser >=3.80.0 <4.0.0
Frameworksvanilla
Languagestypescript
Bundlersvite
Platformsweb, mobile-web

Files installed

  • package.json
  • index.html
  • vite.config.ts
  • tsconfig.json
  • .gitignore
  • gamecn.json
  • README.md(docs)
  • src/main.ts
  • src/scenes/PreloadScene.ts
  • src/scenes/GameScene.ts

Notes

Run

pnpm install
pnpm dev

Then open http://localhost:5173.

Controls

  • SPACE — jump

Project layout

src/
  main.ts                game bootstrap (Phaser config + scene list)
  scenes/
    PreloadScene.ts      asset loading + runtime texture generation
    GameScene.ts         the actual gameplay loop
public/
  assets/                drop your real PNG/audio here once you have art

Replace the placeholder graphics

This template uses runtime-generated colored rectangles for the player and ground. To use real art:

  1. Drop your spritesheet at public/assets/player.png.
  2. In PreloadScene.ts, replace the make(...) calls with this.load.image(...).

What to add next

gamecn add @main/audio-manager
gamecn add @main/input-manager
gamecn add @main/save-load