Spears N' Coins is a tutorial series by Emanuele Feronato showing how to build a complete, playable endless runner from scratch using Phaser 4.1 and TypeScript. If you want to see what a real Phaser 4 project looks like end to end, this is a great place to start.

The game is simple in concept: run, avoid spears coming from the ground, collect coins. Click or tap to move, release to stop. The spears pop up procedurally, the coins add time and score, and a countdown keeps the pressure on. The mechanics are inspired by Dashy Panda.

What makes it interesting from a learning perspective is how much ground it covers in very few lines. The full game lives in a single Game.ts scene file, built on top of the Create Phaser Game app template. Clean, readable, and a solid reference for how to structure a Phaser 4 project with TypeScript.

What You Will Learn from the Spears N' Coins Tutorial

The tutorial walks through building the game from the official Phaser template, covering a wide range of fundamentals:

  • Endless scrolling with TileSprite and object pooling
  • Parallax scrolling for background depth
  • Procedural generation of spears, coins and bushes
  • Sprite animations with idle, run and pickup states
  • Timeline-based animations for the spear movement
  • Game states managing title, running, and game over
  • Collision detection kept forgiving and easy to tune
  • Countdown timer with custom events
  • Persistent best score via localStorage
  • Pixel art config with antialiasing off and pixelArt mode on

The full source code is available to download. A series of detailed tutorials covering each part of the implementation will follow on Emanuele's site.

Built with Phaser 4.1 and TypeScript on Vite

The project uses Phaser 4.1 as the only runtime dependency, with TypeScript 5.7 and Vite 6 handling the build. It's a clean, minimal setup that mirrors what most real Phaser projects look like in 2026, and a good starting point if you want to understand how the pieces fit together before adding more complexity.

Read the Full Tutorial

Emanuele Feronato shares the full source code for Spears N' Coins on his site, along with a breakdown of the project structure. A series of detailed tutorials covering each part of the implementation will follow.

See the Source Code