Extracted speed property
This commit is contained in:
parent
04d16e4ac4
commit
7b1a357998
2 changed files with 3 additions and 1 deletions
|
@ -22,7 +22,7 @@ void Player::update()
|
||||||
}
|
}
|
||||||
|
|
||||||
auto moveDirection = input->direction.asIsometricVector();
|
auto moveDirection = input->direction.asIsometricVector();
|
||||||
auto moveDelta = moveDirection * 30.0f * FRAME_TIME.asSeconds();
|
auto moveDelta = moveDirection * speed * FRAME_TIME.asSeconds();
|
||||||
coordinates.move(moveDelta);
|
coordinates.move(moveDelta);
|
||||||
circle->coordinates.set(coordinates);
|
circle->coordinates.set(coordinates);
|
||||||
}
|
}
|
||||||
|
|
|
@ -22,6 +22,8 @@ public:
|
||||||
|
|
||||||
TrackableState getTrackableState() const override;
|
TrackableState getTrackableState() const override;
|
||||||
|
|
||||||
|
float speed = 30.0f;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
CircleObject *circle;
|
CircleObject *circle;
|
||||||
std::shared_ptr<InputIdentity> input;
|
std::shared_ptr<InputIdentity> input;
|
||||||
|
|
Loading…
Reference in a new issue