Update crates/border-wars/src/camera.rs
All checks were successful
Rust Checks / checks (push) Successful in 2m4s
Rust Checks / checks (pull_request) Successful in 1m49s

This commit is contained in:
CoCo_Sol 2024-03-02 11:13:45 +00:00
parent 2d13997750
commit da38d2932c

View file

@ -45,7 +45,7 @@ pub struct CameraPlugin;
impl Plugin for CameraPlugin {
fn build(&self, app: &mut App) {
app.add_systems(Startup, init_camera)
.add_systems(Startup, init_resources)
.add_systems(Startup, init_resources_for_camera)
.add_systems(Update, movement_system.run_if(in_state(CurrentScene::Game)))
.add_systems(Update, scale_system.run_if(in_state(CurrentScene::Game)));
}
@ -63,7 +63,7 @@ fn init_camera(mut commands: Commands) {
/// - [CameraSpeedScale]: The speed of camera scaling.
/// - [MinimumScale]: The minimum scale of the camera.
/// - [MaximumScale]: The maximum scale of the camera.
fn init_resources(mut commands: Commands) {
fn init_resources_for_camera(mut commands: Commands) {
commands.insert_resource(KeysMovementSettings {
up: KeyCode::Z,
down: KeyCode::S,