-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathZombie.h
More file actions
47 lines (45 loc) · 1.13 KB
/
Zombie.h
File metadata and controls
47 lines (45 loc) · 1.13 KB
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
35
36
37
38
39
40
41
42
43
44
45
46
47
/*
Muhammad Taha Rizwan 23I-0664
Muhammad Aqib 23I-0670
Section - G
*/
#pragma once
#include"Entity.h"
#include"Plant.h"
#include"Shooter.h"
class Zombie :public Entity{
protected:
float speed;
int damage;
int wait;
bool attack;
bool eat;
int score;
//Clock for movement
sf::Clock moveClock;
sf::Clock freezeClock;
sf::Clock waitClock;
bool freeze;
bool plantAhead;
public:
int startY;
//Parent Zombie class from which every other zombie inherit from
Zombie(int x, int y, int tolerance, std::string texturePath, std::string name, double textureX, double textureY, float speed, int damage, int wait, bool attack, int score, int sprites);
float getSpeed()const;
int getScore()const;
int getDamage()const;
std::string getName();
Position getPos();
bool getWait();
//Toggle Freeze
void toggleFreeze();
virtual void move(bool state) = 0;
bool getPlantAhead()const;
void setPlantAhead(bool x);
//Check if frozen, if so, half the speed, and than set it to normal after a certain time
void checkFrozen();
bool getFreeze();
void spawn(int x, int y,int tolarence=0);
virtual void eatPlant(Plant* plant);
virtual ~Zombie() {}
};