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/Wiazkowiec.h
2024-12-20 19:39:18 +01:00

53 lines
1.2 KiB
C++

#ifndef WIAZKOWIEC_H
#define WIAZKOWIEC_H
#include "Enemy.h"
#include "Actor.h"
#include "Beam.h"
enum class DirectionW {
Up,
Down,
Left,
Right
};
class Wiazkowiec : public Actor {
public:
Wiazkowiec(int x, int y, const sf::Texture& texture);
void shoot() override;
void move(float deltaX, float deltaY) override;
void moveLeft() override;
void moveRight() override;
void moveUp() override;
void moveDown() override;
void setRandomDirection();
void update();
void render(sf::RenderWindow &window);
bool isAlive() const;
void takeDamage();
void checkIfBeamShootOutOfBounds();
bool isShooting() const;
const Beam* getBeam() const;
void setPlanszaHeight(float height, float width);
private:
float planszaHeight = 800.f;
float planszaWidth = 600.f;
sf::Clock shootClock;
sf::Texture WiazkaTexture;
float movementSpeed = 2.0f;
bool alive = true;
DirectionW direction = DirectionW::Down;
Beam *beam; // Wiązka
bool shooting = false;
sf::Clock shootingClock;
float beamDuration = 1.0f;
void spawnBeam(); // Tworzy wiązkę
};
#endif //WIAZKOWIEC_H