Player class base
unknown
plain_text
2 years ago
500 B
9
Indexable
class Player
{
public:
sf::vector2f position;
sf::CircleShape shape(5);
Player(sf::vector2f pos)
{
this->position = pos;
this->shape.setFillColor(sf::Color::Red);
this->shape.setPosition(pos);
}
void Draw(sf::RenderWindow& window)
{
window.draw(shape);
}
void Update()
{
this->shape.setPosition(this->position);
}
void Move(sf::vector2f movementVector)
{
this->position += movementVector;
}
}Editor is loading...