Files
down_into_the_void/src/config.rs
T
2026-09-20 17:08:06 +02:00

39 lines
1.2 KiB
Rust

use bevy::prelude::*;
// Fixed game screen
pub const SCREEN_WIDTH: f32 = 720.0;
pub const SCREEN_HEIGHT: f32 = 1080.0;
pub const SCREEN_ASPECT: f32 = SCREEN_WIDTH / SCREEN_HEIGHT; // 2:3
// Grid
pub const CELL_SIZE: f32 = 24.0;
pub const TERRAIN_COLS: i32 = 30;
pub const CHUNK_ROWS: i32 = 32;
pub const TERRAIN_WIDTH: f32 = CELL_SIZE * TERRAIN_COLS as f32;
pub const HALF_TERRAIN_WIDTH: f32 = TERRAIN_WIDTH / 2.0;
pub const CHUNK_HEIGHT: f32 = CELL_SIZE * CHUNK_ROWS as f32;
// Streaming
pub const MARGIN_ABOVE: f32 = 400.0;
pub const MARGIN_BELLOW: f32 = 400.0;
// Player
pub const PLAYER_HITBOX: Vec2 = Vec2::new(16.0, 32.0);
pub const FALL_SPEED: f32 = 500.0;
pub const DIVE_SPEED: f32 = 2000.0;
pub const HORIZONTAL_SPEED: f32 = 400.0;
pub const START_POSITION: Vec3 = Vec3::new(0.0, 0.0, 2.0);
pub const CAMERAE_OFFSET: f32 = 280.0;
// Movement intertia
pub const HORIZONTAL_ACCEL: f32 = 2600.0;
pub const HORIZONTAL_FRICTION: f32 = 1800.0;
pub const VERTICAL_RATE: f32 = 4000.0;
// Validator
pub const INERTIA_MARGIN: f32 = 4.0;
pub const DESIGN_LATERAL_SPEED_RATIO: f32 = 0.6;
pub const DESIGN_SLOPE_COLS_PER_ROW: f32 =
HORIZONTAL_SPEED * DESIGN_LATERAL_SPEED_RATIO / FALL_SPEED;