mirror of
https://github.com/dylanbenzi/pacmen-sfml.git
synced 2026-11-27 08:26:59 +00:00
add basic movement for entity
This commit is contained in:
+5
-3
@@ -30,9 +30,9 @@ struct EntityAnimation {
|
||||
std::vector<sf::Sprite> sprites;
|
||||
};
|
||||
|
||||
class Entity {
|
||||
class Entity : public sf::Transformable {
|
||||
public:
|
||||
Entity() : movementSpeed(5) {};
|
||||
Entity() : movementSpeed({5.0f, 5.0f}) {};
|
||||
|
||||
void setAnimationTiles(sf::Texture& textureSheet, sf::Vector2i pixelLocation, const std::string& animationName, sf::Vector2i tileSize, unsigned int animationTiles, unsigned int pixelGap);
|
||||
|
||||
@@ -40,6 +40,8 @@ public:
|
||||
|
||||
void setActiveSprite(const std::string& animationName, int animationTile);
|
||||
|
||||
void move(MovementDir dir);
|
||||
|
||||
protected:
|
||||
sf::Vector2i tileSize;
|
||||
|
||||
@@ -47,7 +49,7 @@ protected:
|
||||
|
||||
sf::Sprite* activeSprite;
|
||||
|
||||
int movementSpeed;
|
||||
sf::Vector2f movementSpeed;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user