Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

phaser random line

  preload ()
    {
        this.load.image('orb', 'assets/sprites/orb-blue.png');
    }

    create ()
    {
        const group = this.add.group({ key: 'orb', frameQuantity: 300 });

        const line = new Phaser.Geom.Line(200, 200, 500, 400);

        //  Randomly position the sprites on the line
        Phaser.Actions.RandomLine(group.getChildren(), line);
    }
Source by github.com #
 
PREVIOUS NEXT
Tagged: #phaser #random #line
ADD COMMENT
Topic
Name
1+1 =