-
Notifications
You must be signed in to change notification settings - Fork 0
/
Enemy.h
35 lines (27 loc) · 859 Bytes
/
Enemy.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
#pragma once
#include "animatedsprite.h"
//Example of extended Animated Sprite class to create simple enemies
//Should extend this for different types of enemies
//in this game ghost is implimented in enemy because ghost is so simple
//extends AnimatedSprite so it has all of AnimatedSprites vars and methods
class Enemy :
public AnimatedSprite
{
protected:
sf::Clock mClock;
int counter;
bool mIsActive;
public:
Enemy(sf::Vector2f pPosition,
sf::Vector2i pSize,
sf::Texture *pTexture,
sf::Vector2f pVelocity = sf::Vector2f(0,0),
bool pIsActive = true,
float pAngle = 0,
float pAngularVelocity = 0);
virtual ~Enemy(void);
//override animated sprite update method
virtual void update(sf::Vector2f pPlayerPosition);
virtual bool getIsActive() {return mIsActive;}
virtual void setIsActive(bool pBool) { mIsActive = pBool; }
};