Do poprawy centrowanie lasera i strzelanie w lewo i w prawo

This commit is contained in:
2024-12-20 23:38:37 +01:00
parent 0a5a26208a
commit c4c83382c3
8 changed files with 125 additions and 128 deletions

View File

@@ -13,40 +13,47 @@ enum class DirectionW {
class Wiazkowiec : public Actor {
public:
Wiazkowiec(int x, int y, const sf::Texture& texture);
Wiazkowiec(int x, int y, const sf::Texture& texture, sf::RenderWindow *window);
void shoot() override;
void move(float deltaX, float deltaY) override;
void moveLeft() override;
void moveRight() override;
void moveUp() override;
void moveDown() override;
void takeDamage();
void setRandomDirection();
void checkIfBeamShootOutOfBounds();
void update();
void shoot() override;
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);
void setPlanszaHeight(int height, int width);
Beam* getBeam() const;
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::Texture beamTexture;
sf::Clock shootClock;
sf::Clock shootingClock;
float beamDuration = 1.0f;
DirectionW direction = DirectionW::Down;
Beam *beam; // wskaźnik na wiązkę
sf::RenderWindow *window_ptr;
void spawnBeam(); // Tworzy wiązkę
int planszaHeight = 800;
int planszaWidth = 600;
float beamDuration = 1.0f;
float movementSpeed = 2.0f;
bool shooting = false;
bool alive = true;
};
#endif //WIAZKOWIEC_H