Randomize gem color

This commit is contained in:
Alex Page 2022-01-30 01:01:51 -05:00
parent 576bd76bd6
commit 3da6f63b8e

View file

@ -15,6 +15,7 @@ pub struct Map {
tile_content: Vec<Option<Entity>>,
border_fg: RGB,
border_bg: RGB,
gem_color: RGB,
}
impl BaseMap for Map {}
@ -39,6 +40,7 @@ impl Map {
tile_content: vec![None; MAP_SIZE],
border_fg: RGB::named(vga::get_by_index(rng.range(8, 15))),
border_bg: RGB::named(vga::get_by_index(rng.range(1, 7) as usize)),
gem_color: RGB::named(vga::get_by_index(rng.range(1, 15))),
}
}
@ -204,7 +206,11 @@ impl Map {
ctx.set(
x + MAP_X,
y + MAP_Y,
data.color_fg,
if *tile == TileType::Gem {
self.gem_color
} else {
RGB::named(data.color_fg)
},
data.color_bg,
data.glyph,
);