summaryrefslogtreecommitdiff
path: root/src/cell.rs
diff options
context:
space:
mode:
authorTom Barrett <tom@tombarrett.xyz>2021-04-10 12:28:16 +0200
committerTom Barrett <tom@tombarrett.xyz>2021-04-10 12:28:16 +0200
commit6f2cf244f8d92068963207205125f2167768ff53 (patch)
treed279fdb6859726d4362f0ce33e6a30ca37c30267 /src/cell.rs
parent284ad7d9193bafbe44993bada105a92899650af1 (diff)
setup for new tileset
Diffstat (limited to 'src/cell.rs')
-rw-r--r--src/cell.rs5
1 files changed, 4 insertions, 1 deletions
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<Occupant> for Standard {
fn sample<R: Rng + ?Sized>(&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,
}
}