feat: dino class for drawing, updating and managing the player object

This commit is contained in:
theoleuthardt 2025-03-13 10:54:02 +01:00
parent da4c292fbd
commit 10194544f3
2 changed files with 53 additions and 0 deletions

22
src/Dino.hpp Normal file
View file

@ -0,0 +1,22 @@
#ifndef DINO_HPP
#define DINO_HPP
#include "raylib.h"
class Dino {
public:
explicit Dino(Texture2D texture);
void Jump();
void Update();
void Draw();
Rectangle GetRect();
private:
Texture2D texture;
Rectangle rect;
float velocityY;
bool isJumping;
static constexpr float GRAVITY = 0.4;
static constexpr float JUMP_STRENGTH = -10;
};
#endif //DINO_HPP