class Example extends Phaser.Scene {
preload() {}
create() {
const circle = this.add.circle(config.width / 2, 50, 10, 0xffffff);
this.tweens.add({
targets: circle,
y: 300,
duration: 1500,
repeat: -1,
yoyo: true
});
}
}
const config = {
type: Phaser.AUTO,
transparent: true,
width: 800,
height: 400,
scene: Example
};
const game = new Phaser.Game(config);