Merge branch 'main' of ssh://tudbut.de:222/HAWGameJam13/game
This commit is contained in:
commit
23e76a73cd
3 changed files with 4 additions and 2 deletions
|
@ -99,10 +99,10 @@ fn move_player(
|
||||||
controller.translation = Some(Vec2::new(move_x as f32 * 6., 0. - 0.01));
|
controller.translation = Some(Vec2::new(move_x as f32 * 6., 0. - 0.01));
|
||||||
vel.linvel += Vec2::new(0., move_y as f32 * 6. * METER);
|
vel.linvel += Vec2::new(0., move_y as f32 * 6. * METER);
|
||||||
|
|
||||||
if moved && move_x != 0 && grounded {
|
if move_x != 0 && grounded {
|
||||||
*anim_state = PlayerAnimations::Walk;
|
*anim_state = PlayerAnimations::Walk;
|
||||||
sprite.flip_x = move_x == -1;
|
sprite.flip_x = move_x == -1;
|
||||||
} else if !moved {
|
} else if move_x == 0 && grounded {
|
||||||
*anim_state = PlayerAnimations::Idle;
|
*anim_state = PlayerAnimations::Idle;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -4,6 +4,7 @@ use bevy_rapier2d::prelude::*;
|
||||||
use game::game_plugin;
|
use game::game_plugin;
|
||||||
|
|
||||||
mod game;
|
mod game;
|
||||||
|
mod parallax;
|
||||||
|
|
||||||
const METER: f32 = 100.;
|
const METER: f32 = 100.;
|
||||||
|
|
||||||
|
|
1
src/parallax.rs
Normal file
1
src/parallax.rs
Normal file
|
@ -0,0 +1 @@
|
||||||
|
use bevy::prelude::*;
|
Loading…
Add table
Reference in a new issue