const for balls

This commit is contained in:
nquidox 2026-04-18 20:51:55 +03:00
parent 5749e0a9d0
commit 97cf8adb4f
2 changed files with 7 additions and 2 deletions

View file

@ -6,8 +6,13 @@ pub const CENTER_Y: f32 = 0.0;
// pub const FACTOR_RADIUS: f32 = FACTOR as f32 / 2.0; // pub const FACTOR_RADIUS: f32 = FACTOR as f32 / 2.0;
// основная размерность и масштаб
pub const SCALE: f32 = 1.0;
pub const STEP: f32 = FACTOR as f32 / SCALE; pub const STEP: f32 = FACTOR as f32 / SCALE;
pub const SCALE: f32 = 2.0;
// зависимые размеры
pub const ROUND_BALL_SIZE: f32 = STEP;
pub const BALL_RADIUS: f32 = ROUND_BALL_SIZE / 2.0;
// Z-INDEXES // Z-INDEXES
pub const ROUND_BALL_Z: f32 = 10.0; pub const ROUND_BALL_Z: f32 = 10.0;

View file

@ -26,7 +26,7 @@ pub fn spawn_round_ball(
commands.spawn(( commands.spawn((
Sprite { Sprite {
image, image,
custom_size: Some(Vec2::splat(STEP)), custom_size: Some(Vec2::splat(ROUND_BALL_SIZE)),
..default() ..default()
}, },
Transform::from_translation((track.segments[0].start_pos).extend(ROUND_BALL_Z)), Transform::from_translation((track.segments[0].start_pos).extend(ROUND_BALL_Z)),