You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 

34 lines
525 B

#include "entity.h"
Entity::Entity() :
vector_velocity(0.f, 0.f)
{}
Entity::~Entity()
{}
void Entity::setVelocity(sf::Vector2f vel)
{
vector_velocity = vel;
}
void Entity::setVelocity(float vx, float vy)
{
vector_velocity.x = vx;
vector_velocity.y = vy;
}
const sf::Vector2f& Entity::velocity() const
{
return vector_velocity;
}
void Entity::accelerate(sf::Vector2f vel)
{
vector_velocity += vel;
}
void Entity::updateCurrent(const sf::Time& dt)
{
move(vector_velocity * dt.asSeconds());
}