[Added] Enemy player detection and shooting, [Moved] Lots of entity code to cpp files to avoid circular dependencies
This commit is contained in:
+19
-12
@@ -4,39 +4,46 @@
|
||||
#include "services/AssetService.h"
|
||||
#include "entities/TextureWrapper.h"
|
||||
|
||||
class Crate {
|
||||
class Crate
|
||||
{
|
||||
public:
|
||||
Crate() {
|
||||
this->texture = TextureWrapper(AssetService::getInstance().getSprite(ESprite::CRATE),{32,32});
|
||||
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);
|
||||
Crate(Vector2 pos)
|
||||
{
|
||||
this->texture = TextureWrapper(AssetService::getInstance().getSprite(ESprite::CRATE), {32, 32}, pos);
|
||||
}
|
||||
|
||||
void logic() {
|
||||
|
||||
void logic()
|
||||
{
|
||||
}
|
||||
|
||||
bool hasBeenHit() {
|
||||
bool hasBeenHit()
|
||||
{
|
||||
return this->hit;
|
||||
}
|
||||
|
||||
void setHit(bool hit) {
|
||||
void setHit(bool hit)
|
||||
{
|
||||
this->hit = hit;
|
||||
}
|
||||
|
||||
void draw() {
|
||||
void draw()
|
||||
{
|
||||
DrawTexture(this->texture.getTexture(), this->texture.getPosition().x, this->texture.getPosition().y, WHITE);
|
||||
}
|
||||
|
||||
TextureWrapper& getObject() {
|
||||
TextureWrapper &getObject()
|
||||
{
|
||||
return this->texture;
|
||||
}
|
||||
|
||||
private:
|
||||
TextureWrapper texture;
|
||||
bool hit; // Whether a PBullet has hit the crate
|
||||
bool hit; // Whether a PBullet has hit the crate
|
||||
};
|
||||
|
||||
#endif
|
||||
Reference in New Issue
Block a user