This repository has been archived on 2025-06-06. You can view files and clone it. You cannot open issues or pull requests or push a commit.
Files
LotoStatek/headers/Actor.h
2024-12-10 20:20:05 +01:00

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