Added heart and spawn of them
This commit is contained in:
14
headers/Heart.hpp
Normal file
14
headers/Heart.hpp
Normal file
@@ -0,0 +1,14 @@
|
||||
#ifndef LOTOSTATEK_HEART_HPP
|
||||
#define LOTOSTATEK_HEART_HPP
|
||||
|
||||
#include "SFML/Graphics/Texture.hpp"
|
||||
#include "SFML/Graphics/Sprite.hpp"
|
||||
#include "ObjectItem.hpp"
|
||||
|
||||
class Heart : public ObjectItem {
|
||||
public:
|
||||
Heart(float x, float y, sf::Texture &texture);
|
||||
void update();
|
||||
};
|
||||
|
||||
#endif //LOTOSTATEK_HEART_HPP
|
||||
@@ -12,6 +12,7 @@
|
||||
#include "AudioManager.h"
|
||||
#include "Meteor.h"
|
||||
#include "Plansza.h"
|
||||
#include "Heart.hpp"
|
||||
|
||||
class Plansza {
|
||||
public:
|
||||
@@ -19,7 +20,9 @@ public:
|
||||
Size getSize();
|
||||
std::vector<Meteor> &getMeteors();
|
||||
void spawn_meteor();
|
||||
void spawn_hearts();
|
||||
void update_meteors();
|
||||
void update_hearts();
|
||||
void update();
|
||||
private:
|
||||
Size size;
|
||||
@@ -28,9 +31,13 @@ private:
|
||||
AudioManager audioManager;
|
||||
sf::Texture meteorTexture1;
|
||||
sf::Texture meteorTexture2;
|
||||
sf::Clock spawnClock;
|
||||
sf::Texture heartTexture;
|
||||
sf::Clock meteorSpawnClock;
|
||||
sf::Clock heartSpawnClock;
|
||||
std::vector<Meteor> meteors;
|
||||
std::vector<Heart> hearts;
|
||||
sf::RenderWindow *window;
|
||||
|
||||
};
|
||||
|
||||
#endif //PLANSZA_H
|
||||
|
||||
Reference in New Issue
Block a user