diff --git a/design.md b/design.md index d9e08ec..30c32c5 100644 --- a/design.md +++ b/design.md @@ -17,7 +17,7 @@ It is a liquid layer, an endless sea of extremely hot and destructive lava. It's the end of progression, bottom of the map, can't progress further. The evil source is somewhat above that, at about 100 km. The final goal is the evil source, so player is expected to mine about 100 km deep to beat the game. -1 meter = one block. 100 km = 100,000 blocks deep. +1 meter = one tile. 100 km = 100,000 tiles deep. ## Number of stuff diff --git a/src/world.rs b/src/world.rs index 0e8c641..c0b28f2 100644 --- a/src/world.rs +++ b/src/world.rs @@ -22,28 +22,28 @@ impl Default for World { } const CHUNK_EXTENT: u16 = 256; -const CHUNK_N_BLOCKS: usize = CHUNK_EXTENT as usize * CHUNK_EXTENT as usize; +const CHUNK_N_TILES: usize = CHUNK_EXTENT as usize * CHUNK_EXTENT as usize; -type ChunkBlocks = [Block; CHUNK_N_BLOCKS]; +type ChunkTiles = [Tile; CHUNK_N_TILES]; pub struct Chunk { - blocks: ChunkBlocks, + tiles: ChunkTiles, } impl Chunk { pub fn new_rand() -> Self { let mut rng = thread_rng(); - let mut blocks = [Block { id: 0 }; CHUNK_N_BLOCKS]; - for b in &mut blocks { + let mut tiles = [Tile { id: 0 }; CHUNK_N_TILES]; + for b in &mut tiles { b.id = rng.gen(); } - Self { blocks } + Self { tiles } } } -type BlockId = u16; +type TileId = u16; #[derive(Clone, Copy)] -pub struct Block { - id: BlockId, +pub struct Tile { + id: TileId, }