Added constant for player size.
This commit is contained in:
parent
09e0a5f2d2
commit
e2a48470e5
2 changed files with 3 additions and 1 deletions
|
@ -13,12 +13,13 @@
|
||||||
#include "../items/Weapon.h"
|
#include "../items/Weapon.h"
|
||||||
|
|
||||||
const float Player::SPEED = 100.0f;
|
const float Player::SPEED = 100.0f;
|
||||||
|
const Vector2i Player::SIZE = Vector2i(50, 50);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Initializes Sprite.
|
* Initializes Sprite.
|
||||||
*/
|
*/
|
||||||
Player::Player(b2World& world, Collection& collection, const Vector2f& position) :
|
Player::Player(b2World& world, Collection& collection, const Vector2f& position) :
|
||||||
Sprite("player.png", PhysicalData(position, Vector2i(50, 50), world,
|
Sprite("player.png", PhysicalData(position, SIZE, world,
|
||||||
CATEGORY_ACTOR, MASK_ALL, true)),
|
CATEGORY_ACTOR, MASK_ALL, true)),
|
||||||
Actor(100),
|
Actor(100),
|
||||||
mWeapon(*this, collection, world),
|
mWeapon(*this, collection, world),
|
||||||
|
|
|
@ -38,6 +38,7 @@ protected:
|
||||||
// Private variables.
|
// Private variables.
|
||||||
private:
|
private:
|
||||||
static const float SPEED;
|
static const float SPEED;
|
||||||
|
static const Vector2i SIZE;
|
||||||
Weapon mWeapon; //< Weapon object used for Player::fire().
|
Weapon mWeapon; //< Weapon object used for Player::fire().
|
||||||
Vector2f mDestination; //< Absolute position of the movement destination.
|
Vector2f mDestination; //< Absolute position of the movement destination.
|
||||||
Vector2f mCrosshairPosition; //< Relative position of the point to fire at (mouse cursor).
|
Vector2f mCrosshairPosition; //< Relative position of the point to fire at (mouse cursor).
|
||||||
|
|
Reference in a new issue