1#ifndef _BOMBERMAN_ENTITIES_ENEMY_H_
2#define _BOMBERMAN_ENTITIES_ENEMY_H_
6#include "Entities/Creature.h"
14 enum class AIType :
int
30 Enemy(std::shared_ptr<SDL_Texture> texture, SDL_Renderer* renderer);
37 void moveTo(
const int x,
const int y);
43 void moveToCell(std::pair<int, int> pathToCell);
75 virtual void update(
const unsigned int delta)
override;
88 void updateMovement(
const unsigned int delta);
91 float newPositionX = 0.0f;
92 float newPositionY = 0.0f;
93 bool movingToCell =
false;
94 std::pair<int, int> path;
96 AIType aiType = AIType::Wandering;
98 const float baseSpeedTilesPerSecond = 1.8f;
99 const float attackSpeedTilesPerSecond = 2.5f;
100 const int attackRadius = 4;
102 std::shared_ptr<Animation> movement;
Creature class.
Definition Creature.h:13
Enemy class.
Definition Enemy.h:24
bool isMovingToCell() const
Return is enemy moving to cell or not.
Definition Enemy.cpp:59
int getAttackRadius() const
Get the Attack Radius of enemy.
Definition Enemy.cpp:69
void generateNewPath()
Generate new path if enemy finish movement.
Definition Enemy.cpp:128
void moveToCell(std::pair< int, int > pathToCell)
Move enemy for specified diff of cells.
Definition Enemy.cpp:47
void setAIType(AIType type)
Set AI type.
Definition Enemy.cpp:74
bool canAttack() const
Can enemy attack.
Definition Enemy.cpp:64
void moveTo(const int x, const int y)
Move enemy to specified position.
Definition Enemy.cpp:28
virtual void update(const unsigned int delta) override
Update movement of enemy.
Definition Enemy.cpp:79