How do I implement Gravity

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.

If you’re using Arcade Physics, you can use a sprite or body’s setGravityY().

If you’re not using Arcade Physics, you would need to update the sprite’s velocity and position in scene update().

Thank You It Works!