few additional notes

This commit is contained in:
Noel Berry 2021-01-04 18:57:46 -08:00
parent 7173d65263
commit 14c1d625a1
2 changed files with 9 additions and 4 deletions

View File

@ -3,8 +3,9 @@
namespace TL
{
class Enemy : public Component
{
};
// I just needed a way to track whether any enemies were still
// in the scene or not, so Locked Doors could open. The easiest
// way was to add an Enemy component, and check if there are any
// in the scene.
class Enemy : public Component { };
}

View File

@ -244,6 +244,10 @@ void Player::update()
// hack:
// destroy orb
// ideally we would have an "attack" component that the orb could
// subscribe to, and delete itself when it hits the player. since
// the orb currently has no way to know if it hit the player, we
// have to add this ugly hack!
if (hit->get<Orb>())
hit->entity()->destroy();
}