mirror of
https://github.com/griffi-gh/kubi.git
synced 2024-12-24 04:48:21 -06:00
cobblestone
This commit is contained in:
parent
1b85340d9c
commit
c4fb530258
BIN
assets/blocks/cobblestone.png
Normal file
BIN
assets/blocks/cobblestone.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 578 B |
|
@ -9,4 +9,5 @@ pub enum Block {
|
||||||
Dirt,
|
Dirt,
|
||||||
Grass,
|
Grass,
|
||||||
Sand,
|
Sand,
|
||||||
|
Cobblestone,
|
||||||
}
|
}
|
||||||
|
|
|
@ -24,7 +24,7 @@ pub fn block_placement_system(
|
||||||
//get coord and block type
|
//get coord and block type
|
||||||
let (place_position, place_block) = if action_place {
|
let (place_position, place_block) = if action_place {
|
||||||
let position = (ray.position - ray.direction * 0.5).floor().as_ivec3();
|
let position = (ray.position - ray.direction * 0.5).floor().as_ivec3();
|
||||||
(position, Block::Dirt)
|
(position, Block::Cobblestone)
|
||||||
} else {
|
} else {
|
||||||
(ray.block_position, Block::Air)
|
(ray.block_position, Block::Air)
|
||||||
};
|
};
|
||||||
|
|
|
@ -16,19 +16,20 @@ pub trait AssetPaths {
|
||||||
#[derive(Clone, Copy, Debug, EnumIter)]
|
#[derive(Clone, Copy, Debug, EnumIter)]
|
||||||
#[repr(u8)]
|
#[repr(u8)]
|
||||||
pub enum BlockTexture {
|
pub enum BlockTexture {
|
||||||
Stone = 0,
|
Stone,
|
||||||
Dirt = 1,
|
Dirt,
|
||||||
GrassTop = 2,
|
GrassTop,
|
||||||
GrassSide = 3,
|
GrassSide,
|
||||||
Sand = 4,
|
Sand,
|
||||||
Bedrock = 5,
|
Bedrock,
|
||||||
Wood = 6,
|
Wood,
|
||||||
WoodTop = 7,
|
WoodTop,
|
||||||
Leaf = 8,
|
Leaf,
|
||||||
Torch = 9,
|
Torch,
|
||||||
TallGrass = 10,
|
TallGrass,
|
||||||
Snow = 11,
|
Snow,
|
||||||
GrassSideSnow = 12,
|
GrassSideSnow,
|
||||||
|
Cobblestone,
|
||||||
}
|
}
|
||||||
impl AssetPaths for BlockTexture {
|
impl AssetPaths for BlockTexture {
|
||||||
fn file_name(self) -> &'static str {
|
fn file_name(self) -> &'static str {
|
||||||
|
@ -46,6 +47,7 @@ impl AssetPaths for BlockTexture {
|
||||||
Self::TallGrass => "tall_grass.png",
|
Self::TallGrass => "tall_grass.png",
|
||||||
Self::Snow => "snow.png",
|
Self::Snow => "snow.png",
|
||||||
Self::GrassSideSnow => "grass_side_snow.png",
|
Self::GrassSideSnow => "grass_side_snow.png",
|
||||||
|
Self::Cobblestone => "cobblestone.png",
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -41,6 +41,12 @@ impl BlockDescriptorSource for Block {
|
||||||
collision: CollisionType::Solid,
|
collision: CollisionType::Solid,
|
||||||
raycast_collision: true,
|
raycast_collision: true,
|
||||||
},
|
},
|
||||||
|
Self::Cobblestone => BlockDescriptor {
|
||||||
|
name: "cobblestone",
|
||||||
|
render: RenderType::SolidBlock(CubeTexture::all(BlockTexture::Cobblestone)),
|
||||||
|
collision: CollisionType::Solid,
|
||||||
|
raycast_collision: true,
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue