[Added] Crates, Hud for bullets and health

This commit is contained in:
Ninjaws
2024-12-15 00:12:16 +01:00
parent 55792bb954
commit de958b02e6
17 changed files with 448 additions and 38 deletions
+48
View File
@@ -0,0 +1,48 @@
#ifndef CRATE_H
#define CRATE_H
#include "services/AssetService.h"
#include "entities/TextureWrapper.h"
#include "entities/PBullet.h"
class Crate {
public:
Crate() {
this->texture = TextureWrapper(AssetService::getInstance().getSprite(ESprite::CRATE),{32,32});
}
Crate(Vector2 pos) {
this->texture = TextureWrapper(AssetService::getInstance().getSprite(ESprite::CRATE),{32,32}, pos);
}
void logic() {
}
bool hasBeenHit() {
return this->hit;
}
void setHit(bool hit) {
this->hit = hit;
}
void draw() {
DrawTexture(this->texture.getTexture(), this->texture.getPosition().x, this->texture.getPosition().y, WHITE);
}
TextureWrapper& getObject() {
return this->texture;
}
private:
TextureWrapper texture;
bool hit; // Whether a PBullet has hit the create
};
#endif