Single Atlas Frame Bob

Demonstrates how to create a Blitter Bob using a specific frame from a loaded texture atlas.

Single Atlas Frame Bob, running
1024 × 768
GitHub
class Example extends Phaser.Scene
{
    preload ()
    {
        this.load.setBaseURL('https://cdn.phaserfiles.com/v410');

        this.load.atlas('atlas', 'assets/atlas/megaset-2.png', 'assets/atlas/megaset-2.json');

    }

    create ()
    {

        const blitter = this.add.blitter(0, 0, 'atlas', 'hotdog');

        const bob = blitter.create(100, 100);

    }
}

const config = {
    scale: { mode: Phaser.Scale.FIT },
    type: Phaser.WEBGL,
    parent: 'game-container',
    scene: Example
};

const game = new Phaser.Game(config);

More in Blitter17 examples