From 14c1d625a179ef70b5edc903d2acfbc2f6e05317 Mon Sep 17 00:00:00 2001 From: Noel Berry Date: Mon, 4 Jan 2021 18:57:46 -0800 Subject: [PATCH] few additional notes --- src/components/enemy.h | 9 +++++---- src/components/player.cpp | 4 ++++ 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/src/components/enemy.h b/src/components/enemy.h index 23c8ff1..6ddd546 100644 --- a/src/components/enemy.h +++ b/src/components/enemy.h @@ -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 { }; } \ No newline at end of file diff --git a/src/components/player.cpp b/src/components/player.cpp index c2b6872..a70546c 100644 --- a/src/components/player.cpp +++ b/src/components/player.cpp @@ -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()) hit->entity()->destroy(); }