mirror of
https://github.com/Noratrieb/game-wip-dontplay.git
synced 2026-01-16 12:25:02 +01:00
Scale back coordinate types for new 50 km limit
This commit is contained in:
parent
64735c7455
commit
d41032dbcc
4 changed files with 10 additions and 7 deletions
|
|
@ -18,9 +18,10 @@ impl WorldPos {
|
|||
}
|
||||
}
|
||||
/// Horizontal center of the world
|
||||
pub const CENTER: WorldPosScalar = WorldPosScalar::MAX / 2;
|
||||
/// Vertical surface level
|
||||
pub const SURFACE: WorldPosScalar = WorldPosScalar::MAX / 16;
|
||||
pub const CENTER: WorldPosScalar =
|
||||
(TilePosScalar::MAX / 2) as WorldPosScalar * TILE_SIZE as WorldPosScalar;
|
||||
/// Vertical surface level. You can build 5,000 blocks upwards
|
||||
pub const SURFACE: WorldPosScalar = 5000 * TILE_SIZE as WorldPosScalar;
|
||||
pub const SURFACE_CENTER: Self = Self {
|
||||
x: Self::CENTER,
|
||||
y: Self::SURFACE,
|
||||
|
|
@ -28,7 +29,7 @@ impl WorldPos {
|
|||
}
|
||||
|
||||
pub fn wp_to_tp(wp: WorldPosScalar) -> TilePosScalar {
|
||||
wp / TILE_SIZE as TilePosScalar
|
||||
(wp / TILE_SIZE as WorldPosScalar) as TilePosScalar
|
||||
}
|
||||
|
||||
#[test]
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue