Serduszka działają
do zrobienia jeszcze animacja uderzenia się w meteoryt (miganie) i wybuch statku przy uderzeniu się w meteoryt po raz trzeci
This commit is contained in:
@@ -5,6 +5,7 @@
|
||||
#include "SFML/Graphics/Texture.hpp"
|
||||
#include "Bullet.h"
|
||||
#include "Position.h"
|
||||
#include "SFML/System/Clock.hpp"
|
||||
|
||||
|
||||
class Actor {
|
||||
@@ -14,8 +15,9 @@ public:
|
||||
void loadTexture(std::string path);
|
||||
|
||||
sf::Sprite& getSprite();
|
||||
|
||||
unsigned int getHP();
|
||||
Position getPosition();
|
||||
std::vector<Bullet>& getBullets();
|
||||
|
||||
virtual void move(float deltaX, float deltaY) = 0;
|
||||
virtual void moveLeft() = 0;
|
||||
@@ -24,19 +26,19 @@ public:
|
||||
virtual void moveDown() = 0;
|
||||
virtual void shoot() = 0;
|
||||
|
||||
std::vector<Bullet>& getBullets();
|
||||
|
||||
void updateBullets();
|
||||
|
||||
void setMovingSpeed(float speed);
|
||||
void dealDamage();
|
||||
void healUP();
|
||||
|
||||
protected:
|
||||
sf::Sprite actorSprite;
|
||||
sf::Texture actorTexture;
|
||||
sf::Texture bulletTextureLeft;
|
||||
sf::Texture bulletTextureRight;
|
||||
sf::Clock damageDealClock;
|
||||
Position position;
|
||||
unsigned int hp;
|
||||
int hp;
|
||||
unsigned int damage;
|
||||
unsigned int firerate;
|
||||
float moving_speed;
|
||||
|
||||
@@ -25,19 +25,21 @@ public:
|
||||
void update_hearts();
|
||||
void update();
|
||||
private:
|
||||
Size size;
|
||||
sf::RenderWindow *window;
|
||||
Background background;
|
||||
Player ship;
|
||||
AudioManager audioManager;
|
||||
Size size;
|
||||
sf::Texture meteorTexture1;
|
||||
sf::Texture meteorTexture2;
|
||||
sf::Texture heartTexture;
|
||||
sf::Texture heartTextureGray;
|
||||
sf::Clock meteorSpawnClock;
|
||||
sf::Clock heartSpawnClock;
|
||||
std::vector<Meteor> meteors;
|
||||
std::vector<Heart> hearts;
|
||||
sf::RenderWindow *window;
|
||||
|
||||
std::vector<sf::Sprite> heartStats;
|
||||
bool gameOver = false;
|
||||
};
|
||||
|
||||
#endif //PLANSZA_H
|
||||
|
||||
Reference in New Issue
Block a user