Files

49 lines
889 B
C++

#ifndef CRATE_H
#define CRATE_H
#include "services/AssetService.h"
#include "entities/TextureWrapper.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 = false; // Whether a PBullet has hit the crate
};
#endif