Dziala powerup na prędkość poruszania się

This commit is contained in:
2025-01-06 01:31:59 +01:00
parent 3d83a3a767
commit b1b5858fb6
10 changed files with 85 additions and 28 deletions

View File

@@ -6,7 +6,7 @@
class Heart : public ObjectItem {
public:
Heart(float x, float y, sf::Texture &texture);
Heart(float x, float y, sf::Texture &texture_);
void update() override;
};

View File

@@ -7,6 +7,7 @@
class ObjectItem {
public:
virtual ~ObjectItem() = default;
ObjectItem(float x, float y, sf::Texture &texture);
sf::Sprite &getSprite();
bool getStatus();

View File

@@ -15,6 +15,7 @@
#include "AudioManager.h"
#include "Plansza.h"
#include "Heart.hpp"
#include "PowerUp.h"
#include "Size.h"
enum ships{
@@ -31,8 +32,10 @@ public:
std::vector<Meteor> &getMeteors();
void spawn_meteor();
void spawn_hearts();
void spawn_power_up();
void update_meteors();
void update_hearts();
void update_power_ups();
void update();
void update_score();
void spawn_player();
@@ -56,6 +59,7 @@ private:
sf::Font font;
sf::Clock meteorSpawnClock;
sf::Clock heartSpawnClock;
sf::Clock powerUpSpawnClock;
sf::Clock spawnClock;
sf::Clock scoreClock;
sf::Clock shooterSpawnClock;
@@ -79,6 +83,7 @@ private:
sf::Texture meteorTexture2;
sf::Texture heartTexture;
sf::Texture heartTextureGray;
sf::Texture powerUpTexture;
std::vector<Enemy> enemies;
std::vector<AdvancedEnemy> AEnemies;
std::vector<Bomber> BEnemies;
@@ -87,6 +92,7 @@ private:
std::vector<Meteor> meteors;
std::vector<Heart> hearts;
std::vector<sf::Sprite> heartStats;
std::vector<PowerUp> powerUps;
bool gameOver = false;
};

View File

@@ -2,8 +2,10 @@
#define POWERUP_H
#include "ObjectItem.hpp"
class PowerUp : ObjectItem {
class PowerUp : public ObjectItem {
public:
PowerUp(float x, float y, sf::Texture &texture_);
void update() override;
};
#endif //POWERUP_H