mirror of
https://github.com/Noratrieb/game-wip-dontplay.git
synced 2026-01-17 04:45: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
|
|
@ -15,6 +15,8 @@
|
||||||
The evil source is at about 50 km.
|
The evil source is at about 50 km.
|
||||||
The final goal is the evil source, so player is expected to mine about 50 km deep to beat the game.
|
The final goal is the evil source, so player is expected to mine about 50 km deep to beat the game.
|
||||||
1 meter = one tile. 50 km = 50,000 tiles deep.
|
1 meter = one tile. 50 km = 50,000 tiles deep.
|
||||||
|
There could be some post-endgame content from 50,000-60,000 blocks deep.
|
||||||
|
Very unbreakable bottom or lava lake or whatever is at 60,000 blocks deep.
|
||||||
|
|
||||||
## Number of stuff
|
## Number of stuff
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -57,7 +57,7 @@ impl App {
|
||||||
|
|
||||||
fn do_update(&mut self) {
|
fn do_update(&mut self) {
|
||||||
let tp = self.game.camera_offset.tile_pos();
|
let tp = self.game.camera_offset.tile_pos();
|
||||||
self.game.camera_offset.y += 33;
|
self.game.camera_offset.y += 800;
|
||||||
imm_dbg!(tp);
|
imm_dbg!(tp);
|
||||||
imm_dbg!(tp.to_chunk_and_local());
|
imm_dbg!(tp.to_chunk_and_local());
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -18,9 +18,10 @@ impl WorldPos {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
/// Horizontal center of the world
|
/// Horizontal center of the world
|
||||||
pub const CENTER: WorldPosScalar = WorldPosScalar::MAX / 2;
|
pub const CENTER: WorldPosScalar =
|
||||||
/// Vertical surface level
|
(TilePosScalar::MAX / 2) as WorldPosScalar * TILE_SIZE as WorldPosScalar;
|
||||||
pub const SURFACE: WorldPosScalar = WorldPosScalar::MAX / 16;
|
/// 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 {
|
pub const SURFACE_CENTER: Self = Self {
|
||||||
x: Self::CENTER,
|
x: Self::CENTER,
|
||||||
y: Self::SURFACE,
|
y: Self::SURFACE,
|
||||||
|
|
@ -28,7 +29,7 @@ impl WorldPos {
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn wp_to_tp(wp: WorldPosScalar) -> TilePosScalar {
|
pub fn wp_to_tp(wp: WorldPosScalar) -> TilePosScalar {
|
||||||
wp / TILE_SIZE as TilePosScalar
|
(wp / TILE_SIZE as WorldPosScalar) as TilePosScalar
|
||||||
}
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,7 @@
|
||||||
use fnv::FnvHashMap;
|
use fnv::FnvHashMap;
|
||||||
use rand::{thread_rng, Rng};
|
use rand::{thread_rng, Rng};
|
||||||
|
|
||||||
type ChunkPosScalar = u32;
|
type ChunkPosScalar = u16;
|
||||||
|
|
||||||
#[derive(Hash, PartialEq, Eq, Debug, Clone, Copy)]
|
#[derive(Hash, PartialEq, Eq, Debug, Clone, Copy)]
|
||||||
pub struct ChunkPos {
|
pub struct ChunkPos {
|
||||||
|
|
@ -95,7 +95,7 @@ fn test_to_chunk_and_local() {
|
||||||
}
|
}
|
||||||
|
|
||||||
// Need to support at least 4 million tiles long
|
// Need to support at least 4 million tiles long
|
||||||
pub type TilePosScalar = u32;
|
pub type TilePosScalar = u16;
|
||||||
|
|
||||||
const CHUNK_EXTENT: u16 = 128;
|
const CHUNK_EXTENT: u16 = 128;
|
||||||
const CHUNK_N_TILES: usize = CHUNK_EXTENT as usize * CHUNK_EXTENT as usize;
|
const CHUNK_N_TILES: usize = CHUNK_EXTENT as usize * CHUNK_EXTENT as usize;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue