26 void init(std::string texture, std::string texturePath, sf::Vector2f position);
Class for shape and movement of player.
Definition: Player.hpp:9
b2BodyDef _bodyDef
The definition of Box2D body.
Definition: Player.hpp:74
void moveRight()
Move the player right.
Definition: Player.cpp:36
GameDataRef _data
The Shared Pointer of the game data.
Definition: Player.hpp:69
Player(GameDataRef data, WorldRef world)
Construct a new Player object.
Definition: Player.cpp:6
sf::Sprite sprite()
Return the sprite of the Player object.
Definition: Player.cpp:47
void moveLeft()
Move the player left.
Definition: Player.cpp:31
void init(std::string texture, std::string texturePath, sf::Vector2f position)
Initiate the Player object.
Definition: Player.cpp:8
b2Body * _body
The Box2D body of player.
Definition: Player.hpp:75
b2FixtureDef _fixture
The fixture of player for defining its properties.
Definition: Player.hpp:77
sf::Sprite _sprite
The SFML sprite of the player.
Definition: Player.hpp:72
void jump()
Make the player jump.
Definition: Player.cpp:41
b2PolygonShape _rectShape
The polygon shape for fixture definition.
Definition: Player.hpp:76
WorldRef _world
The Shared Pointer of Box2D World.
Definition: Player.hpp:70
void setTexture(std::string texture)
Set the Texture of the sprite.
Definition: Player.cpp:55
void processPosition()
Process the position of Player object.
Definition: Player.cpp:51
Custom namespace used throughout the project.
Definition: AboutState.cpp:6
std::shared_ptr< b2World > WorldRef
The Shared Pointer that points to the Box2D world.
Definition: Game.hpp:51
std::shared_ptr< GameData > GameDataRef
The Shared Pointer of GameData Struct.
Definition: Game.hpp:39