feat: cactus class for drawing, updating and spawning the cacti on the desert

This commit is contained in:
theoleuthardt 2025-03-13 10:55:01 +01:00
parent 10194544f3
commit 9ff73a95e3
2 changed files with 41 additions and 0 deletions

19
src/Cactus.hpp Normal file
View file

@ -0,0 +1,19 @@
#ifndef CACTUS_H
#define CACTUS_H
#include "raylib.h"
class Cactus {
public:
Cactus(Texture2D texture, float x);
void Update();
void Draw();
bool IsOffScreen();
Rectangle GetRect();
private:
Texture2D texture;
Rectangle rect;
static constexpr float SPEED = 5;
};
#endif