Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

phaser place on ellipse

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

    create ()
    {
        this.ellipse = new Phaser.Geom.Ellipse(400, 300, 200, 500);
        this.group = this.add.group({ key: 'ball', frameQuantity: 48 });
        Phaser.Actions.PlaceOnEllipse(this.group.getChildren(), this.ellipse);

        this.tweens.add({
            targets: this.ellipse,
            width: 700,
            height: 100,
            delay: 1000,
            duration: 2000,
            ease: 'Sine.easeInOut',
            repeat: -1,
            yoyo: true
        });
    }

    update ()
    {
        Phaser.Actions.PlaceOnEllipse(this.group.getChildren(), this.ellipse);
    }
Source by github.com #
 
PREVIOUS NEXT
Tagged: #phaser #place #ellipse
ADD COMMENT
Topic
Name
7+4 =