Randomize gem color
This commit is contained in:
parent
576bd76bd6
commit
3da6f63b8e
1 changed files with 7 additions and 1 deletions
|
@ -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,
|
||||
);
|
||||
|
|
Loading…
Add table
Reference in a new issue