Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

phaser random ellipse

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

    create ()
    {
        //  Create 300 sprites (they all start life at 0x0)
        const group = this.add.group({ key: 'orb', frameQuantity: 300 });

        this.ellipse = new Phaser.Geom.Ellipse(400, 300, 100, 200);

        //  Randomly position the sprites within the ellipse
        Phaser.Actions.RandomEllipse(group.getChildren(), this.ellipse);
    }
Source by github.com #
 
PREVIOUS NEXT
Tagged: #phaser #random #ellipse
ADD COMMENT
Topic
Name
8+7 =