Stepped Emitter With Yoyo

Demonstrates a particle emitter where the spawn position increments in discrete steps across a horizontal range and then reverses back.

Stepped Emitter With Yoyo, running
800 × 600
GitHub
class Example extends Phaser.Scene
{
    preload ()
    {
        this.load.setBaseURL('https://cdn.phaserfiles.com/v410');
        this.load.image('bg', 'assets/tweens/sky.png');
        this.load.atlas('match3', 'assets/atlas/match3.png', 'assets/atlas/match3.json');
    }

    create ()
    {
        this.add.image(400, 300, 'bg');

        this.add.particles(0, 100, 'match3', {
            x: { start: 100, end: 640, steps: 16, yoyo: true },
            frame: 'Match3_Icon_19',
            lifespan: 3000,
            gravityY: 200,
            scale: 0.15
        });
    }
}

const config = {
    scale: { mode: Phaser.Scale.FIT },
    type: Phaser.AUTO,
    width: 800,
    height: 600,
    backgroundColor: '#000',
    parent: 'game-container',
    scene: Example
};

const game = new Phaser.Game(config);

More in Particle Emitter44 examples