NPC class inherits Interactable class. More...
#include <NPC.h>
Public Member Functions | |
| NPC (std::string characterSprite, float npcXPos, float npcYPos) | |
| interactiable gets initalized before NPC constructor, beacuse it is a super type of NPC(NPC inherits Interactable) | |
| ~NPC () | |
| void | renderNPC (RenderWindow &window) |
| void | update (RenderWindow &window, const Player &player) override |
| what is displayed | |
Public Member Functions inherited from Interactable | |
| Interactable (std::string interactableTexturePath, std::string interactableName, float interactableRadius, float interactableXRelMap, float interactableYRelMap) | |
| float | getRadius () const |
| bool | playerInRange (const Player &player) |
| void | drawInteractable (RenderWindow &window, const Player &player) |
Static Public Member Functions | |
| static std::unique_ptr< NPC > | createNPC (std::string characterSprite, float npcXPos, float npcYPos) |
| static function so we can access it without creating an instance of the NPC class | |
NPC class inherits Interactable class.
| NPC::NPC | ( | std::string | characterSprite, |
| float | npcXPos, | ||
| float | npcYPos ) |
interactiable gets initalized before NPC constructor, beacuse it is a super type of NPC(NPC inherits Interactable)
gets NPC textture
set NPC sprite
| NPC::~NPC | ( | ) |
|
static |
| void NPC::renderNPC | ( | RenderWindow & | window | ) |
|
overridevirtual |
what is displayed
handles when an NPC is interacted with
draws the pickup text and sets interacted
Reimplemented from Interactable.