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
Andrii Solianyk 72e2116dc7 Refactor of structs
Refactored Size and Position
Placed them in different .h files
2024-12-04 14:47:50 +01:00

47 lines
953 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, std::string path);
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