pacman/lib/include/PacManAnimation.hpp

26 lines
487 B
C++
Raw Normal View History

2021-06-10 12:42:51 +00:00
#pragma once
2020-11-28 12:04:14 +00:00
2021-06-24 11:32:52 +00:00
#include "Atlas.hpp"
#include "Board.hpp"
#include "Direction.hpp"
#include "Position.hpp"
2020-11-28 12:04:14 +00:00
#include <chrono>
2021-07-05 12:10:01 +00:00
namespace pacman {
2020-11-28 12:04:14 +00:00
class PacManAnimation {
public:
2021-08-02 13:31:32 +00:00
GridPosition animationFrame(Direction direction) const;
GridPosition deathAnimationFrame() const;
2020-11-28 12:04:14 +00:00
2021-06-28 10:42:21 +00:00
void updateAnimationPosition(std::chrono::milliseconds time_delta, bool dead);
void pause();
2020-11-28 12:04:14 +00:00
private:
2021-09-10 09:02:37 +00:00
size_t animation_position = 0;
2021-07-05 09:40:10 +00:00
double animation_position_delta = 0.0;
2020-11-28 12:04:14 +00:00
};
2021-07-05 12:10:01 +00:00
} // namespace pacman