class Level extends Phaser.Scene {
constructor() {
super("Level");
this.y=0
this.gems=[]
}
create() {
this.editorCreate();
this.gems.push(this.add.sprite(200, 300, 'red'));
for (let i = 0; i < 8; i++)
{
this.gems.push(this.add.sprite(0, 0, 'blue'));
}
}
update()
{
Phaser.Actions.AlignTo(this.gems,Phaser.Display.Align.RIGHT_CENTER,0,Math.sin(this.y))
this.y +=0.1
}
}
-------------------------------------------------------------------------------
create ()
{
for (let i = 0; i < 26; i++)
{
this.gingerbreads.push(this.add.image(i * 32, 300, 'gingerbread'));
}
}
update ()
{
Phaser.Actions.Angle(this.gingerbreads, 1.5, 0.1);
}