diff options
| -rw-r--r-- | assets/sprites/wizard/img.png | bin | 0 -> 238 bytes | |||
| -rw-r--r-- | assets/sprites/wizard/manifest.toml | 11 | ||||
| -rw-r--r-- | src/content/materials/mod.rs | 13 | ||||
| -rw-r--r-- | src/main.rs | 2 |
4 files changed, 23 insertions, 3 deletions
diff --git a/assets/sprites/wizard/img.png b/assets/sprites/wizard/img.png Binary files differnew file mode 100644 index 0000000..1a41f5e --- /dev/null +++ b/assets/sprites/wizard/img.png diff --git a/assets/sprites/wizard/manifest.toml b/assets/sprites/wizard/manifest.toml new file mode 100644 index 0000000..45327a6 --- /dev/null +++ b/assets/sprites/wizard/manifest.toml @@ -0,0 +1,11 @@ +[palette] +1 = { material = "Cloth" } +2 = { material = "Cloth" } +3 = { material = "Cloth" } +4 = { material = "Cloth" } +5 = { material = "Cloth" } +6 = { material = "Steel" } +7 = { material = "Tnt" } +8 = { material = "Cloth" } +9 = { material = "Cloth" } +10 = { material = "Cloth" }
\ No newline at end of file diff --git a/src/content/materials/mod.rs b/src/content/materials/mod.rs index 819ec2a..f4a5ab5 100644 --- a/src/content/materials/mod.rs +++ b/src/content/materials/mod.rs @@ -18,6 +18,7 @@ pub enum MaterialId { Smoke, Steel, Tnt, + Cloth, } #[repr(u8)] @@ -38,7 +39,7 @@ pub struct MaterialDef { pub sim_update: Option<fn(ctx: &mut UpdateCtx) -> PostUpdateAction>, } -static MATERIALS: [MaterialDef; 8] = [ +static MATERIALS: [MaterialDef; 9] = [ MaterialDef { name: "Void", color: (0x00, 0x00, 0x00, 0x00), @@ -98,10 +99,17 @@ static MATERIALS: [MaterialDef; 8] = [ form: MaterialForm::Solid, sim_update: None, }, + MaterialDef { + name: "Cloth", + color: (0x23, 0x27, 0x63, 0xFF), + density: 25, + form: MaterialForm::Solid, + sim_update: None, + }, ]; impl MaterialId { - pub const ALL: [MaterialId; 8] = [ + pub const ALL: [MaterialId; 9] = [ MaterialId::Void, MaterialId::Sand, MaterialId::Wood, @@ -110,6 +118,7 @@ impl MaterialId { MaterialId::Smoke, MaterialId::Steel, MaterialId::Tnt, + MaterialId::Cloth, ]; #[inline] pub fn def(self) -> &'static MaterialDef { diff --git a/src/main.rs b/src/main.rs index 21460bd..9c702a8 100644 --- a/src/main.rs +++ b/src/main.rs @@ -103,7 +103,7 @@ impl App { if self.input_manager.pressed(Input::Action5) { sim.create_entity(EntityDef::from_sprite( self.input_manager.world_mouse_pos, - "assets/sprites/chair", + "assets/sprites/wizard", None, )); } |
