Direct Value Particle Emitter

Demonstrates a basic particle emitter using constant numeric values for properties like speed, lifespan, and gravity.

Direct Value Particle Emitter, running
800 × 600
GitHub
class Example extends Phaser.Scene
{
    preload ()
    {
        this.load.setBaseURL('https://cdn.phaserfiles.com/v410');
        this.load.image('star', 'assets/demoscene/star3.png');
    }

    create ()
    {
        this.add.particles(400, 200, 'star', {
            speed: 100,
            lifespan: 3000,
            gravityY: 200
        });
    }
}

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