47 lines
963 B
C++
47 lines
963 B
C++
#ifndef ACTOR_H
|
|
#define ACTOR_H
|
|
|
|
#include "SFML/Graphics/Sprite.hpp"
|
|
#include "SFML/Graphics/Texture.hpp"
|
|
#include "Bullet.h"
|
|
#include "Position.h"
|
|
|
|
|
|
class Actor {
|
|
public:
|
|
Actor(int x, int y, const sf::Texture& texture);
|
|
|
|
void loadTexture(std::string path);
|
|
|
|
sf::Sprite& getSprite();
|
|
|
|
Position getPosition();
|
|
|
|
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();
|
|
|
|
void updateBullets();
|
|
|
|
void setMovingSpeed(float speed);
|
|
|
|
protected:
|
|
sf::Sprite actorSprite;
|
|
sf::Texture actorTexture;
|
|
sf::Texture bulletTextureLeft;
|
|
sf::Texture bulletTextureRight;
|
|
Position position;
|
|
unsigned int hp;
|
|
unsigned int damage;
|
|
unsigned int firerate;
|
|
float moving_speed;
|
|
std::vector<Bullet> bullets;
|
|
};
|
|
|
|
#endif //ACTOR_H
|