wiazkowiec strzela, gora dol
This commit is contained in:
51
headers/Wiazkowiec.h
Normal file
51
headers/Wiazkowiec.h
Normal file
@@ -0,0 +1,51 @@
|
||||
#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 updateDirection();
|
||||
bool isShooting() const;
|
||||
const Beam& getBeam() const;
|
||||
|
||||
|
||||
private:
|
||||
sf::Clock shootClock;
|
||||
sf::Texture WiazkaTexture;
|
||||
float movementSpeed = 2.0f;
|
||||
bool alive = true;
|
||||
DirectionW direction = DirectionW::Down;
|
||||
Beam beam; // Wiązka
|
||||
bool shooting = false; // Czy obecnie strzela
|
||||
sf::Clock shootingClock; // Zegar kontrolujący czas strzału
|
||||
float beamDuration = 1.0f; // Czas trwania widoczności wiązki (w sekundach)
|
||||
|
||||
void spawnBeam(); // Tworzy wiązkę
|
||||
};
|
||||
|
||||
#endif //WIAZKOWIEC_H
|
||||
Reference in New Issue
Block a user