There's a simple death screen now and you can exit. More work on what death means later.
This commit is contained in:
parent
f2864a62ee
commit
6cabd62c7f
5 changed files with 72 additions and 19 deletions
|
@ -99,6 +99,7 @@ void System::death(DinkyECS::World &world) {
|
|||
// BUG: maybe that can be allowed and looting just shows
|
||||
// BUG: all dead things there?
|
||||
auto &collider = world.get_the<SpatialMap>();
|
||||
auto player = world.get_the<Player>();
|
||||
|
||||
world.query<Position, Combat>([&](const auto &ent, auto &position, auto &combat) {
|
||||
// bring out yer dead
|
||||
|
@ -107,8 +108,12 @@ void System::death(DinkyECS::World &world) {
|
|||
// take them out of collision map
|
||||
collider.remove(position.location);
|
||||
|
||||
// remove their motion so they're dead
|
||||
world.remove<Motion>(ent);
|
||||
if(ent == player.entity) {
|
||||
world.send<Events::GUI>(Events::GUI::DEATH, ent, {});
|
||||
} else {
|
||||
// remove their motion so they're dead
|
||||
world.remove<Motion>(ent);
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue