From fe1af23d9005376f55953e3a1ceba77776bb5423 Mon Sep 17 00:00:00 2001 From: Schrottkatze Date: Sat, 23 Nov 2024 22:24:45 +0100 Subject: [PATCH 1/2] animation fixes --- src/game/player.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/game/player.rs b/src/game/player.rs index eeba809..2d14413 100644 --- a/src/game/player.rs +++ b/src/game/player.rs @@ -99,10 +99,10 @@ fn move_player( controller.translation = Some(Vec2::new(move_x as f32 * 6., 0. - 0.01)); vel.linvel += Vec2::new(0., move_y as f32 * 3. * METER); - if moved && move_x != 0 && grounded { + if move_x != 0 && grounded { *anim_state = PlayerAnimations::Walk; sprite.flip_x = move_x == -1; - } else if !moved { + } else if move_x == 0 && grounded { *anim_state = PlayerAnimations::Idle; } } From f6298ad94b13cf99d060142850e279496ec5b3f3 Mon Sep 17 00:00:00 2001 From: Schrottkatze Date: Sat, 23 Nov 2024 22:55:19 +0100 Subject: [PATCH 2/2] parallax init ja lol ey --- src/main.rs | 1 + src/parallax.rs | 1 + 2 files changed, 2 insertions(+) create mode 100644 src/parallax.rs diff --git a/src/main.rs b/src/main.rs index d1f327c..fc356f7 100644 --- a/src/main.rs +++ b/src/main.rs @@ -4,6 +4,7 @@ use bevy_rapier2d::prelude::*; use game::game_plugin; mod game; +mod parallax; const METER: f32 = 60.; diff --git a/src/parallax.rs b/src/parallax.rs new file mode 100644 index 0000000..26a6fc8 --- /dev/null +++ b/src/parallax.rs @@ -0,0 +1 @@ +use bevy::prelude::*;