Changed Player initial position to be passed in constructor.

This commit is contained in:
Felix Ableitner 2012-09-10 17:54:17 +02:00
parent 45f0b31d57
commit 34f0f95bce
3 changed files with 4 additions and 4 deletions

View file

@ -30,7 +30,7 @@ Game::Game(const Vector2i& resolution) :
mView(Vector2f(0, 0), Vector2f(resolution)),
//mFps("test"),
mTileManager(mWorld),
mPlayer(mWorld, mCollection),
mPlayer(mWorld, mCollection, Vector2f(200.0f, 100.0f)),
mElapsed(0),
mQuit(false),
mPaused(false) {

View file

@ -17,8 +17,8 @@ const float Player::SPEED = 100.0f;
/**
* Initializes Sprite.
*/
Player::Player(b2World& world, Collection& collection) :
Sprite("player.png", PhysicalData(Vector2f(200.0f, 100.0f), Vector2i(50, 50), world,
Player::Player(b2World& world, Collection& collection, const Vector2f& position) :
Sprite("player.png", PhysicalData(position, Vector2i(50, 50), world,
CATEGORY_ACTOR, MASK_ALL, true)),
mWeapon(*this, collection, world),
mDestination(Vector2i(50, 50)) {

View file

@ -24,7 +24,7 @@ class Sprite;
class Player : public Sprite, public Actor {
// Public functions.
public:
Player(b2World& world, Collection& collection);
Player(b2World& world, Collection& collection, const Vector2f& position);
void setCrosshairPosition(const Vector2f& position);
void fire();