Animation and fps
This commit is contained in:
parent
0432d6932c
commit
366bdf7d20
4 changed files with 22 additions and 3 deletions
|
|
@ -19,16 +19,22 @@ class Entity{
|
|||
|
||||
class Pacman : public Entity{
|
||||
const int speed = 16;
|
||||
const int frame_count = 7;
|
||||
const int fps = 24;
|
||||
private:
|
||||
Texture2D texture;
|
||||
int facing;
|
||||
|
||||
Rectangle getTextureRect() const;
|
||||
public:
|
||||
unsigned char frame;
|
||||
float time;
|
||||
|
||||
Pacman();
|
||||
Pacman(Vector2 position);
|
||||
~Pacman();
|
||||
void tick() override;
|
||||
void process() override;
|
||||
void animation_tick();
|
||||
void draw() const override;
|
||||
};
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue