powerups fully implemented
This commit is contained in:
@@ -60,6 +60,9 @@ private:
|
||||
sf::Clock meteorSpawnClock;
|
||||
sf::Clock heartSpawnClock;
|
||||
sf::Clock powerUpSpawnClock;
|
||||
sf::Clock movingSpeedPUTimer;
|
||||
sf::Clock fireratePUTimer;
|
||||
sf::Clock tripleShotPUTimer;
|
||||
sf::Clock spawnClock;
|
||||
sf::Clock scoreClock;
|
||||
sf::Clock shooterSpawnClock;
|
||||
@@ -83,7 +86,9 @@ private:
|
||||
sf::Texture meteorTexture2;
|
||||
sf::Texture heartTexture;
|
||||
sf::Texture heartTextureGray;
|
||||
sf::Texture powerUpTexture;
|
||||
sf::Texture movingSpeedPowerUpTexture;
|
||||
sf::Texture fireratePowerUpTexture;
|
||||
sf::Texture tripleShotPowerUpTexture;
|
||||
std::vector<Enemy> enemies;
|
||||
std::vector<AdvancedEnemy> AEnemies;
|
||||
std::vector<Bomber> BEnemies;
|
||||
|
||||
@@ -29,6 +29,7 @@ public:
|
||||
void moveUp() override;
|
||||
void moveDown() override;
|
||||
void takeDamage();
|
||||
void setTripleShot(bool toogle);
|
||||
|
||||
void update();
|
||||
std::vector<Rocket>& getRockets();
|
||||
@@ -44,6 +45,7 @@ private:
|
||||
sf::Clock immortalityClock; // Zegar kontrolujący czas nieśmiertelności
|
||||
float immortalityDuration = 1.5f; // Czas trwania nieśmiertelności w sec
|
||||
bool isImmortal = false; // flaga na immortal
|
||||
bool tripleShot = false; // flaga na potrójny strzał
|
||||
};
|
||||
|
||||
|
||||
|
||||
@@ -4,8 +4,22 @@
|
||||
|
||||
class PowerUp : public ObjectItem {
|
||||
public:
|
||||
PowerUp(float x, float y, sf::Texture &texture_);
|
||||
enum Type {
|
||||
movingSpeedUp,
|
||||
firerateUp,
|
||||
tripleShotUp
|
||||
};
|
||||
|
||||
PowerUp(float x, float y, sf::Texture &texture, Type type);
|
||||
|
||||
void update() override;
|
||||
|
||||
Type getType() const {
|
||||
return type_;
|
||||
}
|
||||
|
||||
private:
|
||||
Type type_;
|
||||
};
|
||||
|
||||
#endif //POWERUP_H
|
||||
|
||||
Reference in New Issue
Block a user