Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

phaser place on triangle

  preload ()
    {
        this.load.image('ball', 'assets/sprites/chunk.png');
    }

    create ()
    {
        // var triangle = new Phaser.Geom.Triangle.BuildEquilateral(400, 100, 380);
        const triangle = new Phaser.Geom.Triangle.BuildRight(200, 400, 300, 200);
        const group = this.add.group({ key: 'ball', frameQuantity: 64 });
        Phaser.Actions.PlaceOnTriangle(group.getChildren(), triangle);
    }
Source by github.com #
 
PREVIOUS NEXT
Tagged: #phaser #place #triangle
ADD COMMENT
Topic
Name
2+1 =