From a57c8a0334a9e0c845151dd37524268e26238924 Mon Sep 17 00:00:00 2001 From: Brian Fertig Date: Tue, 29 Jul 2025 08:28:20 -0600 Subject: [PATCH] Quick Player Updates --- src/characters/player.js | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/src/characters/player.js b/src/characters/player.js index 0e3cfb9..317d0fb 100644 --- a/src/characters/player.js +++ b/src/characters/player.js @@ -88,12 +88,10 @@ export class Player extends Phaser.GameObjects.Sprite { // Movement: Up/Down: if (this.scene.cursors.up.isDown) { this.body.setVelocityY(-200); - this.body.setVelocityX(0); this.anims.play('south', true); this.facing = 'south'; } else if (this.scene.cursors.down.isDown) { this.body.setVelocityY(200); - this.body.setVelocityX(0); this.anims.play('north', true); this.facing = 'north'; } else { @@ -103,13 +101,11 @@ export class Player extends Phaser.GameObjects.Sprite { // Movement: Left/Right: if (this.scene.cursors.left.isDown) { this.body.setVelocityX(-200); - this.body.setVelocityY(0); this.setFlipX(false); this.anims.play('side', true); this.facing = 'west'; } else if (this.scene.cursors.right.isDown) { this.body.setVelocityX(200); - this.body.setVelocityY(0); this.setFlipX(true); this.anims.play('side', true); this.facing = 'east'; @@ -118,7 +114,7 @@ export class Player extends Phaser.GameObjects.Sprite { } // Idle - if (this.body.velocity.x === 0) { + if (this.body.velocity.x === 0 && this.body.velocity.y === 0) { this.anims.play('idle', true); } }