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/Player.h
Andrii Solianyk 2341c2fa6d New Projectiles class
Refactor of Bullet class
Different method of shooting.
2024-12-01 17:44:25 +01:00

30 lines
737 B
C++

#ifndef LOTOSTATEK_PLAYER_H
#define LOTOSTATEK_PLAYER_H
#include <chrono>
#include "Actor.h"
#include "Rocket.h"
class Player : public Actor {
public:
Player(int x, int y, std::string path);
void shoot() override;
void alternate_shoot();
void setFirerate(unsigned int firerate);
void move(float deltaX, float deltaY) override;
void moveLeft() override;
void moveRight() override;
void moveUp() override;
void moveDown() override;
std::vector<Rocket>& getRockets();
private:
std::chrono::steady_clock::time_point lastShotTime = std::chrono::steady_clock::now();
std::vector<Rocket> rockets;
sf::Texture rocketTexture;
sf::Texture bulletTexture;
};
#endif //LOTOSTATEK_PLAYER_H