From 6c423f69c22ef0ea86cb3478f0ab1903d6162b2c Mon Sep 17 00:00:00 2001 From: Jarrod Doyle Date: Wed, 31 Jan 2024 15:06:39 +0000 Subject: [PATCH] Add water Element with associated u32 conversion and render colour No rules or placement logic for the water is added yet. --- src/falling_sand/mod.rs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/falling_sand/mod.rs b/src/falling_sand/mod.rs index 106c4a0..83c3e9d 100644 --- a/src/falling_sand/mod.rs +++ b/src/falling_sand/mod.rs @@ -209,6 +209,7 @@ pub fn update_chunk_texture_system( match element { Element::Air => colour = (25, 24, 26), Element::Sand => colour = (255, 216, 102), + Element::Water => colour = (120, 220, 232), _ => {} } } @@ -230,6 +231,7 @@ pub enum Element { None, Air, Sand, + Water, } impl From for Element { @@ -237,6 +239,7 @@ impl From for Element { match value { x if x == Element::Air as u32 => Element::Air, x if x == Element::Sand as u32 => Element::Sand, + x if x == Element::Water as u32 => Element::Water, _ => Element::None, } }