Multiple Blitter Bobs
Demonstrates how to create a Blitter game object and add multiple individual 'bob' instances to it at different positions using a single texture.
1024 × 768
class Example extends Phaser.Scene
{
preload ()
{
this.load.setBaseURL('https://cdn.phaserfiles.com/v410');
this.load.image('atari', 'assets/sprites/atari130xe.png');
}
create ()
{
const blitter = this.add.blitter(0, 0, 'atari');
blitter.create(0, 0);
blitter.create(200, 50);
blitter.create(400, 100);
blitter.create(600, 150);
}
}
const config = {
scale: { mode: Phaser.Scale.FIT },
type: Phaser.WEBGL,
parent: 'game-container',
scene: Example
};
const game = new Phaser.Game(config);