#include #include #include "graphics/animation.h" #include "entity.h" class Unit: public Entity{ public: Graphics::Animation animation; Unit(){ animation = Graphics::Animation("angle1.png", 6, 60); }; ~Unit(){}; }; int main() { sf::RenderWindow renderWindow(sf::VideoMode(640, 480), "Demo Game"); sf::Event event; sf::Clock clock; Unit unit; renderWindow.setFramerateLimit(60); while (renderWindow.isOpen()){ int dt = clock.getElapsedTime().asMilliseconds(); clock.restart(); while (renderWindow.pollEvent(event)){ if (event.type == sf::Event::EventType::Closed) renderWindow.close(); } renderWindow.clear(); renderWindow.draw(unit.animation.next(dt)); renderWindow.display(); } }