This repository has been archived on 2025-06-06. You can view files and clone it. You cannot open issues or pull requests or push a commit.
Files
LotoStatek/headers/Enemy.h
2024-12-10 20:20:05 +01:00

40 lines
731 B
C++

#ifndef ENEMY_H
#define ENEMY_H
#include "Actor.h"
#include "SFML/System/Clock.hpp"
enum class Direction {
Up,
Down,
Left,
Right
};
class Enemy : public Actor {
public:
Enemy(int x, int y, const sf::Texture& texture) ;
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 enemyBulletTexture;
float movementSpeed = 2.0f;
bool alive = true;
Direction direction = Direction::Down;
};
#endif // ENEMY_H