mirror of
https://github.com/theoleuthardt/DinoGame.git
synced 2026-06-13 09:27:57 +00:00
feat: cactus class for drawing, updating and spawning the cacti on the desert
This commit is contained in:
parent
10194544f3
commit
9ff73a95e3
2 changed files with 41 additions and 0 deletions
19
src/Cactus.hpp
Normal file
19
src/Cactus.hpp
Normal 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
|
||||
Loading…
Add table
Add a link
Reference in a new issue