Dziala powerup na prędkość poruszania się
This commit is contained in:
@@ -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;
|
||||
};
|
||||
|
||||
|
||||
@@ -7,6 +7,7 @@
|
||||
|
||||
class ObjectItem {
|
||||
public:
|
||||
virtual ~ObjectItem() = default;
|
||||
ObjectItem(float x, float y, sf::Texture &texture);
|
||||
sf::Sprite &getSprite();
|
||||
bool getStatus();
|
||||
|
||||
@@ -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;
|
||||
};
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user