Skip to content

Commit

Permalink
cleanup controller logic
Browse files Browse the repository at this point in the history
  • Loading branch information
tsukinoko-kun committed Jul 2, 2024
1 parent 3b4634b commit 83c8b41
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 49 deletions.
43 changes: 0 additions & 43 deletions src/gamepad.rs

This file was deleted.

2 changes: 0 additions & 2 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,14 +21,12 @@ use bevy::prelude::*;
mod player;
mod cam;
mod movement;
mod gamepad;

fn main() {
App::new()
.add_plugins(DefaultPlugins.set(ImagePlugin::default_nearest()))
.add_plugins(player::PlayerPlugin)
.add_plugins(movement::MovementPlugin)
.add_plugins(gamepad::GamepadPlugin)
.add_plugins(cam::CamPlugin)
.run();
}
4 changes: 0 additions & 4 deletions src/player.rs
Original file line number Diff line number Diff line change
Expand Up @@ -111,16 +111,12 @@ fn player_input(
if let Some(left_stick_x) = axes.get(GamepadAxis::new(gamepad, GamepadAxisType::LeftStickX)) {
if left_stick_x.abs() > 0.1 {
velocity.value.x = left_stick_x * PLAYER_MOVE_SPEED;
} else {
velocity.value.x = 0.0;
}
}

if let Some(left_stick_y) = axes.get(GamepadAxis::new(gamepad, GamepadAxisType::LeftStickY)) {
if left_stick_y.abs() > 0.1 {
velocity.value.y = left_stick_y * PLAYER_MOVE_SPEED;
} else {
velocity.value.y = 0.0;
}
}
}
Expand Down

0 comments on commit 83c8b41

Please sign in to comment.