#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 |
| 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
| Inventory Player::getInventory | ( | ) |
get and set inventory
| float Player::getplayerSpriteHeight | ( | ) |
| float Player::getplayerSpriteWidth | ( | ) |
| float Player::getPlayerXRelativeToMap | ( | ) | const |
| float Player::getPlayerYRelativeToMap | ( | ) | const |
| void Player::renderPlayer | ( | RenderWindow & | window | ) |
| void Player::setInventory | ( | Inventory * | inventory | ) |
| 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
|
static |