monster variety
This commit is contained in:
parent
3929824670
commit
4f6151307c
@ -148,13 +148,19 @@ fn main() {
|
|||||||
})
|
})
|
||||||
.build();
|
.build();
|
||||||
|
|
||||||
|
let mut rng = rltk::RandomNumberGenerator::new();
|
||||||
|
|
||||||
for room in map.rooms.iter().skip(1) {
|
for room in map.rooms.iter().skip(1) {
|
||||||
let (x, y) = room.center();
|
let (x, y) = room.center();
|
||||||
|
let glyph = match rng.roll_dice(1,2) {
|
||||||
|
1 => { rltk::to_cp437('g') }
|
||||||
|
_ => { rltk::to_cp437('o') }
|
||||||
|
};
|
||||||
gs.ecs
|
gs.ecs
|
||||||
.create_entity()
|
.create_entity()
|
||||||
.with(Position { x, y })
|
.with(Position { x, y })
|
||||||
.with(Renderable {
|
.with(Renderable {
|
||||||
glyph: rltk::to_cp437('g'),
|
glyph: glyph,
|
||||||
fg: RGB::named(rltk::RED),
|
fg: RGB::named(rltk::RED),
|
||||||
bg: RGB::named(rltk::BLACK),
|
bg: RGB::named(rltk::BLACK),
|
||||||
})
|
})
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user