Compare commits
No commits in common. "1a7c3074c62b798c0c21c622f050d3281485fa3f" and "89fa6b8a0f2f1695d6042a6fc1a1c6cd5973a9ab" have entirely different histories.
1a7c3074c6
...
89fa6b8a0f
File diff suppressed because it is too large
Load Diff
|
@ -2,11 +2,11 @@ cargo-features = ["codegen-backend"]
|
|||
|
||||
[package]
|
||||
name = "avoid-rs"
|
||||
version = "0.2.1"
|
||||
version = "0.2.0"
|
||||
edition = "2021"
|
||||
|
||||
[dependencies]
|
||||
bevy = { version = "0.15.2", features = ["wav"] }
|
||||
bevy = { version = "0.15", features = ["wav"] }
|
||||
fastrand = "*"
|
||||
|
||||
[profile.dev]
|
||||
|
|
|
@ -1,2 +1,2 @@
|
|||
[toolchain]
|
||||
channel = "nightly-2025-02-03"
|
||||
channel = "nightly"
|
||||
|
|
24
src/hud.rs
24
src/hud.rs
|
@ -133,20 +133,18 @@ fn start_button_logic(
|
|||
let mut score_text = score_text_query.single_mut();
|
||||
let (mut player_transform, mut player_visibility) = player_query.single_mut();
|
||||
|
||||
let gamepad = gamepads.get_single();
|
||||
let gamepad = gamepads.single();
|
||||
|
||||
if let Ok(gamepad) = gamepad {
|
||||
if gamepad.just_pressed(GamepadButton::Start) {
|
||||
start_game(
|
||||
&mut score_text,
|
||||
&mut score,
|
||||
&mut state,
|
||||
&mut ui_elems_query,
|
||||
&mut player_visibility,
|
||||
&mut player_transform,
|
||||
);
|
||||
return;
|
||||
}
|
||||
if gamepad.just_pressed(GamepadButton::Start) {
|
||||
start_game(
|
||||
&mut score_text,
|
||||
&mut score,
|
||||
&mut state,
|
||||
&mut ui_elems_query,
|
||||
&mut player_visibility,
|
||||
&mut player_transform,
|
||||
);
|
||||
return;
|
||||
}
|
||||
|
||||
let (interaction, mut border_color) = button.single_mut();
|
||||
|
|
|
@ -59,12 +59,10 @@ fn move_player(
|
|||
window: Query<&Window>,
|
||||
) {
|
||||
let (mut transform, mut velocity) = query.single_mut();
|
||||
let gamepad = gamepads.get_single();
|
||||
let gamepad = gamepads.single();
|
||||
velocity.0 = Vec2::ZERO;
|
||||
|
||||
if let Ok(gamepad) = gamepad {
|
||||
handle_gamepad_movement(gamepad, &mut velocity);
|
||||
}
|
||||
handle_gamepad_movement(gamepad, &mut velocity);
|
||||
|
||||
if keys.pressed(KeyCode::ArrowRight) {
|
||||
velocity.x += 1.0;
|
||||
|
|
Loading…
Reference in New Issue