Dodanie bombera

This commit is contained in:
2024-12-11 16:33:24 +01:00
parent 81b04bae0f
commit 2234e4d973
9 changed files with 255 additions and 35 deletions

41
headers/Bomber.h Normal file
View File

@@ -0,0 +1,41 @@
//
// 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 update();
bool isAlive() const;
void takeDamage();
void updateDirection();
private:
sf::Clock shootClock;
sf::Texture BombaTexture;
float movementSpeed = 2.0f;
bool alive = true;
DirectionB direction = DirectionB::Down;
};
#endif //BOMBER_H