Hello everyone, I have a pretty basic problem. Gravity system is not working for me.
const config = {
type: Phaser.AUTO,
width: 640,
height: 360,
parent: 'phaser-game',
physics: {
default: 'arcade',
fps: 60,
gravity: { y: 300 },
arcade: { debug: true }
},
scene: [Scene]
}
and in update function I have something like that:
update() {
if (this.cursors.up.isDown) {
this.player.setVelocityY(-Math.abs(this.player.body.velocity.x));
}
}
Example:
https://dbrebirth.zaba.ovh/
Just hold right arrow and click up arrow.