Hello Phaser Community,
I am new to Phaser and Javascript in general. I am trying to make a simple rhythm game where the objective is to spawn several circles repeatedly over time. I am struggling to do that. I have tried all the examples that exist online but nothing works. Some includes:
https://phaser.io/tutorials/making-your-first-phaser-3-game/part10
https://phaser.io/examples/v2/time/basic-repeat-event
https://phaser.discourse.group/t/random-spawning/3318/3
my code is as follows:
//creating scene
let gameScene = new Phaser.Scene(“Game”);
//configuration
let config = {
type: Phaser.AUTO,
width: 650,
height: 750,
scene: gameScene,
physics: {
default: ‘arcade’,
arcade: {
debug: false
}
}
};
//create the game
let game = new Phaser.Game(config);
//load assets
gameScene.preload = function(){
this.load.image(‘circle’, ‘assets/whiteCircle2.png’);
this.load.image(‘reddot’, ‘assets/reddot.png’);
this.load.image(‘whitedot’, ‘assets/whitedot.png’);
};
//create assests
gameScene.create = function(){
this.reddot = this.add.sprite(325,100,'reddot');
this.reddots = this.add.group();
this.circle = this.add.sprite(325,600,'circle');
this.whitedot = this.add.sprite(325,300,'whitedot');
this.circle.setScale(1.2);
};
//update
gameScene.update = function(){
this.reddot.y += 2;
};