Add a camera system #69

Merged
CoCo_Sol merged 15 commits from camera into main 2024-03-02 11:18:13 +00:00
Showing only changes of commit da38d2932c - Show all commits

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,