-
Notifications
You must be signed in to change notification settings - Fork 0
/
enemy.h
34 lines (30 loc) · 1016 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
#ifndef ENEMY_H
#define ENEMY_H
#include "Player.h"
#include "game_object.h"
#include "Crate.h"
class enemy : public game_object {
public:
explicit enemy(const float &chase_speed,const Zeni::String &modl,
const Zeni::Point3f &corner,
const Zeni::Vector3f &scale,
const Zeni::Quaternion &rotation = Zeni::Quaternion::Axis_Angle(Zeni::Vector3f(0.0f, 0.0f, 1.0f), 0.0f)): game_object(modl,corner,scale,rotation),
stopped(false), go_chase(true), speed(chase_speed), direction(Zeni::Point3f(0,0,0)){}
void chase(Crate::Player &player, float &step);
//rest a bit after successfully attack
void rest();
//go chase after a certain time
void cont_chase();
void calc_dir();
void stop(const bool &stopit);
void create_body();
private:
Zeni::Point3f user_pos;
Zeni::Chronometer<Zeni::Time> chill;
Zeni::Chronometer<Zeni::Time> aim;
Zeni::Point3f direction;
bool go_chase;
float speed;
bool stopped;
};
#endif