Kamikadze sledzi gracza
This commit is contained in:
@@ -1,8 +1,45 @@
|
||||
//
|
||||
// Created by k on 11.12.2024.
|
||||
//
|
||||
|
||||
#ifndef KAMIKADZE_H
|
||||
#define KAMIKADZE_H
|
||||
|
||||
#include "Enemy.h"
|
||||
#include "Actor.h"
|
||||
#include "Player.h"
|
||||
enum class DirectionK {
|
||||
Up,
|
||||
Down,
|
||||
Left,
|
||||
Right
|
||||
};
|
||||
|
||||
class Kamikadze : public Actor {
|
||||
public:
|
||||
Kamikadze(int x, int y, const sf::Texture& texture);
|
||||
|
||||
void move(float deltaX, float deltaY) override;
|
||||
void moveLeft() override;
|
||||
void moveRight() override;
|
||||
void moveUp() override;
|
||||
void moveDown() override;
|
||||
void setRandomDirection();
|
||||
void shoot() override;
|
||||
|
||||
void update(const sf::Vector2f& playerPosition);
|
||||
|
||||
bool isAlive() const;
|
||||
void takeDamage();
|
||||
void updateDirection();
|
||||
|
||||
void followPlayer(const sf::Vector2f &playerPosition);
|
||||
|
||||
void explode(const sf::Vector2f &playerPosition, bool &playerHit);
|
||||
|
||||
private:
|
||||
bool exploding = false; // Czy kamikadze obecnie eksploduje
|
||||
sf::Clock explosionClock;
|
||||
sf::Clock shootClock;
|
||||
float movementSpeed = 2.0f;
|
||||
bool alive = true;
|
||||
DirectionK direction = DirectionK::Down;
|
||||
};
|
||||
|
||||
#endif //KAMIKADZE_H
|
||||
|
||||
Reference in New Issue
Block a user