From 6f2cf244f8d92068963207205125f2167768ff53 Mon Sep 17 00:00:00 2001 From: Tom Barrett Date: Sat, 10 Apr 2021 12:28:16 +0200 Subject: setup for new tileset --- src/cell.rs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'src/cell.rs') diff --git a/src/cell.rs b/src/cell.rs index b697076..10c11f0 100644 --- a/src/cell.rs +++ b/src/cell.rs @@ -12,6 +12,7 @@ pub enum Occupant { Yellow, Red, Blue, + Purple, Explosion, } @@ -28,6 +29,7 @@ impl Occupant { Occupant::Yellow => constants::TILESHEET_YELLOW, Occupant::Red => constants::TILESHEET_RED, Occupant::Blue => constants::TILESHEET_BLUE, + Occupant::Purple => constants::TILESHEET_PURPLE, Occupant::Explosion => constants::TILESHEET_EXPLOSION1, Occupant::None => constants::TILESHEET_NONE1, } @@ -36,11 +38,12 @@ impl Occupant { impl Distribution for Standard { fn sample(&self, rng: &mut R) -> Occupant { - match rng.gen_range(0..=3) { + match rng.gen_range(0..=4) { 0 => Occupant::Green, 1 => Occupant::Yellow, 2 => Occupant::Blue, 3 => Occupant::Red, + 4 => Occupant::Purple, _ => Occupant::None, } } -- cgit v1.2.3