WebVision Canvas
Workflows

phaser js examples for Phaser Studio workflows

03
Fix jittery tilemaps

Fix jittery tilemaps when camera follows sprite

Tilemaps often jitter when the camera follows a sprite. The cause is tentative. The agent reads the scene code and adjusts the camera follow settings. It then runs your build command to verify the project still builds, and you must check the jitter in the browser. You review the diff before accepting the change.

01

Open project folder

Open the folder in the agent chat window.

02

List scene files

The agent lists all scene files in the folder.

03

Read scene code

The agent reads the main scene code file.

04

Run build command

The agent runs the build command to check errors.

Basic game structure

src/main.js
class MainScene extends Phaser.Scene {
  constructor() {
    super('MainScene');
  }
  create() {
    this.add.text(400, 300, 'Hello World', {
      fontSize: '32px',
      fill: '#ffffff'
    });
  }
}
const config = {
  type: Phaser.AUTO,
  width: 800,
  height: 600,
  scene: MainScene
};
new Phaser.Game(config);

This plain JavaScript example shows a basic scene class with a text object. The config sets the game type to AUTO and defines the width and height.

phaser typescript workflow

Analyze scene code

The agent uses list_dir to map the project structure and find the scene files, so it reads the main code with read_file to understand the game. It works locally. It searches for game objects using grep to locate errors. It reads the official Phaser documentation with web_search and http_get to verify method signatures. You review the plan in Plan only mode to see changes. You can switch to Ask first to approve each edit. It applies the edits and shows you the diff for every file. You test the phaser js examples by checking how to change path position and scale in your browser.

Fix camera jitter

The agent uses glob to find all tilemap and sprite files in the project and reads the camera follow logic in the scene code using read_file. It checks. The agent searches for the specific camera settings that cause the jitter effect. It checks the official Phaser documentation for camera smoothing options. It modifies the camera follow settings in the scene file using edit_file. You can fix jittery tilemaps when camera follows sprite by adjusting these settings. The agent runs your dev server command to start the local development server. Shell shows the real exit code of the command and the user checks the result in the browser.

WebVision Canvas for Windows

Start your Phaser project today

Download WebVision Canvas ↗