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

#include <Player.h>

Public Member Functions

 Player (const std::string characterTexturePath, Vector2u windowSize, std::shared_ptr< Map > mapRef, std::shared_ptr< Camera > cameraRef)
 
void renderPlayer (RenderWindow &window)
 
float getPlayerXRelativeToMap () const
 
float getPlayerYRelativeToMap () const
 
float getplayerSpriteHeight ()
 
float getplayerSpriteWidth ()
 
Inventory getInventory ()
 get and set inventory
 
void setInventory (Inventory *inventory)
 
void update (float deltaTime)
 

Static Public Attributes

static const int MAX_SLOTS = 156
 

Constructor & Destructor Documentation

◆ Player()

Player::Player ( const std::string characterTexturePath,
Vector2u windowSize,
std::shared_ptr< Map > mapRef,
std::shared_ptr< Camera > cameraRef )

gets the sprite sheet used to animate the player

loads player texture(for testing)

get character texture of the specific position of the player state is taken

scale character

initalises the players position and sets the cameras position

sets the position of the player on the map

define items to add to inv

Add items to inventory, add item texture path to textures vector in IntroState.cpp before pushing to inventory randomly push items to inventory

Member Function Documentation

◆ getInventory()

Inventory Player::getInventory ( )

get and set inventory

◆ getplayerSpriteHeight()

float Player::getplayerSpriteHeight ( )

◆ getplayerSpriteWidth()

float Player::getplayerSpriteWidth ( )

◆ getPlayerXRelativeToMap()

float Player::getPlayerXRelativeToMap ( ) const

◆ getPlayerYRelativeToMap()

float Player::getPlayerYRelativeToMap ( ) const

◆ renderPlayer()

void Player::renderPlayer ( RenderWindow & window)

◆ setInventory()

void Player::setInventory ( Inventory * inventory)

◆ update()

void Player::update ( float deltaTime)

if the player is moving play the walking sound effect

sets the looping of the sound to be true

locks sound to play the whole time and not repeat rapidly

if the player is NOT moving stop the walking sound effect

sets the looping of the sound to be false

Member Data Documentation

◆ MAX_SLOTS

const int Player::MAX_SLOTS = 156
static

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