From 11ae27cefebdadab797ca162e3ef6fec6f08d361 Mon Sep 17 00:00:00 2001 From: zefad Date: Fri, 18 Sep 2026 17:46:29 +0200 Subject: [PATCH] cleaning --- src/background.rs | 2 +- src/collision.rs | 2 +- src/player.rs | 2 +- src/score.rs | 2 +- src/world.rs | 6 +++--- 5 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/background.rs b/src/background.rs index 643bed9..e84a5a7 100644 --- a/src/background.rs +++ b/src/background.rs @@ -14,7 +14,7 @@ const COLS: i64 = (BOARD_WIDTH / CELL_SIZE).ceil() as i64; pub fn spawn_background_chunk(commands: &mut Commands, id: i64) { for row in (id * ROWS_PER_CHUNK)..(id * ROWS_PER_CHUNK + ROWS_PER_CHUNK) { for col in 0..COLS { - let color = if (row + col as i64) % 2 == 0 { + let color = if (row + col) % 2 == 0 { COLOR_A } else { COLOR_B diff --git a/src/collision.rs b/src/collision.rs index 86d9d5f..7bbdb54 100644 --- a/src/collision.rs +++ b/src/collision.rs @@ -16,7 +16,7 @@ pub struct HasCollided(pub bool); // Check collision with Player pub fn check_collision_with_player( - mut player: Single<(&Transform, &Collider, &mut Sprite), With>, + player: Single<(&Transform, &Collider, &mut Sprite), With>, obstacle: Query<(&Transform, &Collider), With>, mut has_collided: ResMut, ) { diff --git a/src/player.rs b/src/player.rs index 5cc5caf..a58535d 100644 --- a/src/player.rs +++ b/src/player.rs @@ -85,7 +85,7 @@ pub(crate) fn move_player( // Reset player position pub fn reset_player( - mut player: Single<(&mut Transform, &mut Velocity, &mut Sprite), With>, + player: Single<(&mut Transform, &mut Velocity, &mut Sprite), With>, input: Res>, mut has_collided: ResMut, mut fall_started: ResMut, diff --git a/src/score.rs b/src/score.rs index 8172cff..cdf153e 100644 --- a/src/score.rs +++ b/src/score.rs @@ -36,7 +36,7 @@ fn spawn_depth_text(mut commands: Commands) { fn update_depth_text( mut commands: Commands, depth: Res, - mut texts: Query<&mut Text, With>, + texts: Query<&mut Text, With>, ) { for mut text in texts { text.0 = format!("Score: {}", depth.0); diff --git a/src/world.rs b/src/world.rs index 36642d7..adcce51 100644 --- a/src/world.rs +++ b/src/world.rs @@ -2,9 +2,9 @@ use bevy::prelude::*; use crate::{camera::MainCamera, player::Player}; -pub const CHUNK_HEIGHT: f32 = 700.0; // Height of a cunk -const MARGIN_BELLOW: f32 = 400.0; // Height bellow the camera view it'll be gen -const MARGIN_ABOVE: f32 = 400.0; // Height above the camera view it'll be gen +pub const CHUNK_HEIGHT: f32 = 200.0; // Height a cunk +const MARGIN_BELLOW: f32 = 500.0; // Height bellow the camera view it'll be gen +const MARGIN_ABOVE: f32 = 500.0; // Height above the camera view it'll be gen #[derive(Component)] pub struct Chunk {