visibile area highlighting

This commit is contained in:
2020-03-29 20:36:52 -04:00
parent bafe3fcbc9
commit 222e2e5e74
3 changed files with 19 additions and 25 deletions

View File

@@ -85,26 +85,22 @@ pub fn draw_map(ecs: &World, ctx: &mut Rltk) {
for (idx, tile) in map.tiles.iter().enumerate() {
// Render a tile depending upon the tile type, if revealed
if map.revealed_tiles[idx] {
let glyph;
let mut fg;
match tile {
TileType::Floor => {
ctx.set(
x,
y,
RGB::from_f32(0.5, 0.5, 0.5),
RGB::from_f32(0., 0., 0.),
rltk::to_cp437('.'),
);
glyph = rltk::to_cp437('.');
fg = RGB::from_f32(0.5, 0.5, 0.5);
}
TileType::Wall => {
ctx.set(
x,
y,
RGB::from_f32(0.0, 1.0, 0.0),
RGB::from_f32(0., 0., 0.),
rltk::to_cp437('#'),
);
glyph = rltk::to_cp437('#');
fg = RGB::from_f32(0.0, 1.0, 0.0);
}
}
if !map.visible_tiles[idx] {
fg = fg.to_greyscale()
}
ctx.set(x, y, fg, RGB::from_f32(0., 0., 0.), glyph);
}
// Move the coordinates