How do I implement gravity on the circle? I am currently trying to make a flappy bird game.
var config = {
type: Phaser.AUTO,
width: 800,
height: 600,
scene: {
preload: preload,
create: create,
update: update
}
};
const game = new Phaser.Game(config);
function preload() {
}
function create() {
this.player = [];
this.player.x = 400;
this.player.y = 300;
this.player.k = this.input.keyboard.addKeys("W,A,S,D");
this.player.speed = 10;
this.player.sprite = this.add.circle(this.player.x, this.player.y, 50, 0xffffff);
}
Thank you in advance.