EchoesOfFate
A game for our COMP315 Project
 
Loading...
Searching...
No Matches
Interactable Class Reference

#include <Interactable.h>

Inheritance diagram for Interactable:
NPC

Public Member Functions

 Interactable (std::string interactableTexturePath, std::string interactableName, float interactableRadius, float interactableXRelMap, float interactableYRelMap)
 
float getRadius () const
 
bool playerInRange (const Player &player)
 
virtual void update (RenderWindow &window, const Player &player)
 
void drawInteractable (RenderWindow &window, const Player &player)
 

Constructor & Destructor Documentation

◆ Interactable()

Interactable::Interactable ( std::string interactableTexturePath,
std::string interactableName,
float interactableRadius,
float interactableXRelMap,
float interactableYRelMap )

error handling for loading interactable texture

sets interactable object

set default scale of objects

set the font of the text and set the text

change text if it is an NPC you are interacting with

Member Function Documentation

◆ drawInteractable()

void Interactable::drawInteractable ( RenderWindow & window,
const Player & player )

NPCs have their own scaling

◆ getRadius()

float Interactable::getRadius ( ) const

◆ playerInRange()

bool Interactable::playerInRange ( const Player & player)

◆ update()

void Interactable::update ( RenderWindow & window,
const Player & player )
virtual

handles player input

sets position of text to be displayed if in radius

if it is an NPC the object should not disappear

Reimplemented in NPC.


The documentation for this class was generated from the following files: