Brawl Stars Inspired
Smooth joystick following and intuitive touch controls just like Brawl Stars.

A highly customizable and strongly typed virtual joystick component for Phaser.js games, inspired by the smooth and intuitive controls from Brawl Stars. Perfect for mobile games and touch-based interactions.
Brawl Stars Inspired
Smooth joystick following and intuitive touch controls just like Brawl Stars.
Fully Customizable
Colors, sizes, transparency, and visual styling - customize every aspect.
Touch Optimized
Designed specifically for mobile and touch devices with smart bounds detection.
High Performance
Lightweight and optimized for games with smooth 60fps performance.
Strongly Typed
Full TypeScript support with comprehensive type definitions.
Event Driven
Listen to move, press, and release events with rich data.
import { VirtualJoystick } from 'phaser-virtual-joystick';
export class GameScene extends Phaser.Scene {  private joystick!: VirtualJoystick;  private player!: Phaser.Physics.Arcade.Sprite;
  create() {    // Create the virtual joystick    this.joystick = new VirtualJoystick({      scene: this    });
    // ⚠️ IMPORTANT: Don't forget to add the joystick to the scene!    this.add.existing(this.joystick);
    // Create a player sprite    this.player = this.physics.add.sprite(400, 300, 'player');
    // Listen to joystick events    this.joystick.on('move', (data) => {      // data.x and data.y are normalized between -1 and 1      this.player.setVelocity(        data.x * 200, // Move speed        data.y * 200      );    });
    this.joystick.on('release', () => {      this.player.setVelocity(0, 0);    });  }
  update() {    // Update joystick (required for smooth following behavior)    this.joystick?.update();  }}🚨 DON’T FORGET TO ADD THE JOYSTICK TO THE SCENE!
Always remember to call this.add.existing(joystick) or scene.add.existing(joystick) after creating the joystick. The joystick won’t work without being added to the scene!
// ✅ Correctconst joystick = new VirtualJoystick({ scene: this });this.add.existing(joystick); // This is essential!
// ❌ Wrong - joystick won't workconst joystick = new VirtualJoystick({ scene: this });// Missing: this.add.existing(joystick);npm install phaser-virtual-joystick# oryarn add phaser-virtual-joystick# orpnpm add phaser-virtual-joystickMobile gaming requires intuitive controls that feel natural to touch users. While Phaser provides excellent input handling, creating a polished virtual joystick from scratch can be time-consuming and challenging.
Phaser Virtual Joystick solves this by providing:
Ready to add professional mobile controls to your Phaser game? Let’s get started!