46 lines
937 B
C++
46 lines
937 B
C++
//
|
|
// Created by k on 11.12.2024.
|
|
//
|
|
|
|
#ifndef BOMBER_H
|
|
#define BOMBER_H
|
|
|
|
#include "Enemy.h"
|
|
#include "Actor.h"
|
|
enum class DirectionB {
|
|
Up,
|
|
Down,
|
|
Left,
|
|
Right
|
|
};
|
|
|
|
class Bomber : public Actor {
|
|
public:
|
|
Bomber(int x, int y, const sf::Texture& texture, const sf::Texture& bulletTexture);
|
|
|
|
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();
|
|
|
|
bool isAlive() const;
|
|
void takeDamage();
|
|
void updateDirection();
|
|
void setPlanszaHeight(float height, float width);
|
|
|
|
private:
|
|
float planszaHeight = 800.f;
|
|
float planszaWidth = 600.f;
|
|
sf::Clock shootClock;
|
|
sf::Texture BombaTexture;
|
|
float movementSpeed = 2.0f;
|
|
bool alive = true;
|
|
DirectionB direction = DirectionB::Down;
|
|
};
|
|
#endif //BOMBER_H
|