Search
 
SCRIPT & CODE EXAMPLE
 

JAVASCRIPT

phaser random triangle

 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 triangle = new Phaser.Geom.Triangle.BuildEquilateral(400, 100, 380);
        // var triangle = new Phaser.Geom.Triangle.BuildRight(200, 400, 300, 200);

        //  Randomly position the sprites within the triangle
        Phaser.Actions.RandomTriangle(group.getChildren(), triangle);
    }
Comment

PREVIOUS NEXT
Code Example
Javascript :: phaser rotate container facing point 
Javascript :: phaser wrap in camera bounds 
Javascript :: phaser animation repeat event 
Javascript :: phaser export animation to json 
Javascript :: phaser animation on update event 
Javascript :: phaser stagger play 2 
Javascript :: lookbehind alternative regex 
Javascript :: Is he gonna survive 
Javascript :: remove text in div JQuery zqqqqqqqqqqqqqqqzzzzzzzzzzzzzzzzzzzzzzzzzzzzzqqqqqqqqqqqqqqqqqq 
Javascript :: white for file loaded 
Javascript :: get random item in array 
Javascript :: nodejs: redirect path to specific path 
Javascript :: how to target a hidden html element by js 
Javascript :: golang read json file 
Javascript :: jquery selectors 
Javascript :: javascript check item is checkbox 
Javascript :: class declaration in javascript 
Javascript :: sorting an array 
Javascript :: vuejs 
Javascript :: grid in js 
Javascript :: event.target 
Javascript :: javascript map with arrow function 
Javascript :: remove array from array javascript 
Javascript :: javascript set header text 
Javascript :: An unhandled exception occurred: Script file ../node_modules/jquery/dist/jquery.min.js does not exist. 
Javascript :: scroll position 
Javascript :: destroy method 
Javascript :: loop for of 
Javascript :: how to clear radio field in jquery 
Javascript :: callbacks in jquery 
ADD CONTENT
Topic
Content
Source link
Name
8+8 =