mirror of
https://github.com/kuhyx/testsAndMisc.git
synced 2026-07-04 16:23:04 +02:00
26 lines
454 B
C++
26 lines
454 B
C++
#ifndef ENTITY_CPP
|
|
#define ENTITY_CPP
|
|
|
|
void Entity::SetVelocity(sf::Vector2f velocity)
|
|
{
|
|
mVelocity = velocity;
|
|
}
|
|
|
|
void Entity::setVelocity(float velocityX, float velocityY)
|
|
{
|
|
mVelocity.x = velocityX;
|
|
mVelocity.y = velocityY;
|
|
}
|
|
|
|
sf::Vector2f Entity::getVelocity() const
|
|
{
|
|
return mVelocity;
|
|
}
|
|
|
|
void Entity::updateCurrent(sf::Time deltaTime)
|
|
{
|
|
move(mVelocity * deltaTime.asSeconds()); // shortcut for setPosition(getPosition() + offset)
|
|
}
|
|
|
|
#endif
|