# Conflicts: # CMakeLists.txt # headers/Actor.h # headers/Plansza.h # headers/Player.h # sources/Plansza.cpp # sources/Player.cpp
55 lines
1.2 KiB
C++
55 lines
1.2 KiB
C++
#ifndef ACTOR_H
|
|
#define ACTOR_H
|
|
|
|
#include "SFML/Graphics/Sprite.hpp"
|
|
#include "SFML/Graphics/Texture.hpp"
|
|
#include "Bullet.h"
|
|
#include "Position.h"
|
|
#include "SFML/System/Clock.hpp"
|
|
|
|
|
|
class Actor {
|
|
public:
|
|
Actor(int x, int y, const sf::Texture& texture);
|
|
|
|
|
|
|
|
sf::Sprite& getSprite();
|
|
unsigned int getHP();
|
|
Position getPosition();
|
|
std::vector<Bullet>& getBullets();
|
|
|
|
virtual void move(float deltaX, float deltaY) = 0;
|
|
virtual void moveLeft() = 0;
|
|
virtual void moveRight() = 0;
|
|
virtual void moveUp() = 0;
|
|
virtual void moveDown() = 0;
|
|
virtual void shoot() = 0;
|
|
|
|
std::vector<Bullet>& getBullets();
|
|
sf::Sprite& getSprite();
|
|
Position getPosition();
|
|
void updateBullets();
|
|
void setMovingSpeed(float speed);
|
|
void dealDamage();
|
|
void healUP();
|
|
|
|
void updateBullets();
|
|
|
|
protected:
|
|
Position position;
|
|
sf::Sprite actorSprite;
|
|
sf::Texture actorTexture;
|
|
sf::Texture bulletTexture;
|
|
sf::Texture rocketTexture;
|
|
std::vector<Bullet> bullets;
|
|
sf::Clock damageDealClock;
|
|
Position position;
|
|
int hp;
|
|
unsigned int damage;
|
|
unsigned int firerate;
|
|
float moving_speed;
|
|
};
|
|
|
|
#endif //ACTOR_H
|