Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

phaser random circle

  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 });
        const circle = new Phaser.Geom.Circle(400, 300, 130);

        //  Randomly position the sprites within the circle
        Phaser.Actions.RandomCircle(group.getChildren(), circle);
    }
Source by github.com #
 
PREVIOUS NEXT
Tagged: #phaser #random #circle
ADD COMMENT
Topic
Name
4+6 =