Drawing Sprites with Pointer Move

Demonstrates how to create and place sprites along the path of the pointer while it is held down and moving across the screen.

Drawing Sprites with Pointer Move, running
800 × 600
GitHub
class Example extends Phaser.Scene
{
    preload ()
    {
        this.load.setBaseURL('https://cdn.phaserfiles.com/v410');
        this.load.spritesheet('balls', 'assets/sprites/balls.png', { frameWidth: 17, frameHeight: 17 });
    }

    create ()
    {
        this.input.on('pointermove', function (pointer)
        {

            if (pointer.isDown)
            {
                this.add.image(pointer.x, pointer.y, 'balls', Phaser.Math.Between(0, 5));
            }

        }, this);
    }
}

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

const game = new Phaser.Game(config);

More in Pointer12 examples