[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
+5 -6
View File
@@ -16,7 +16,6 @@ public:
{
this->position = pos;
this->direction = direction;
std::cout << direction << std::endl;
}
// ~Bullet() {}
@@ -25,8 +24,8 @@ public:
{
move();
hasCollided = false;
envCollision();
objCollision();
envCollision();
// // detectCollision();
}
@@ -42,14 +41,14 @@ public:
protected:
Color color = RED;
Vector2 position;
int size = 7;
bool hasCollided = false;
private:
// TextureWrapper object;
Vector2 position;
float direction;
float velocity = 15.0f;
int size = 7;
bool hasCollided = false;
void move()
{
@@ -59,7 +58,7 @@ private:
}
void envCollision()
{
if (position.y < 0 || position.y > GetScreenHeight())
if (position.x < 0 || position.y < 0 || position.y > GetScreenHeight())
{
hasCollided = true;
return;