visibile area highlighting
This commit is contained in:
24
src/main.rs
24
src/main.rs
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user