Dodanie bombera
This commit is contained in:
41
headers/Bomber.h
Normal file
41
headers/Bomber.h
Normal 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
|
||||
Reference in New Issue
Block a user