-
Notifications
You must be signed in to change notification settings - Fork 0
/
ModuleCars.h
60 lines (50 loc) · 1.4 KB
/
ModuleCars.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
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
#ifndef __MODULECARS_H__
#define __MODULECARS_H__
#include "Module.h"
#include "Animation.h"
#include "Globals.h"
#include "Point.h"
#include "Timer.h"
#include "ModuleCollision.h"
struct SDL_Texture;
enum Movement { STRAIGHT, RIGHT, LEFT };
enum Status { IDLE, TURBO, BREAK, TO_BORDER, EXPLOTE, DEAD};
enum Weapon { NONE = -1, GUN, OIL, SPRAY, ROCKET, BOMB, RAZOR, BULLET_ENEMY, WORKING };
enum CARS { PLAYER = 0, RED_CAR = 1, BLUE_CAR = 2, MOTO = 3, TRUCK = 4, ROAD_LORD = 6, SWITCH_BLADE = 7, ENFORCER = 8 , MAD_BOMBER = 10 };
class ModuleCars : public Module
{
public:
ModuleCars(CARS car, bool start_enabled = true);
~ModuleCars();
virtual bool Start();
virtual bool Resume();
virtual update_status PreUpdate();
virtual update_status Update();
virtual bool Stop();
virtual bool OnColision(Collider* a, Collider *b);
virtual void SetMovement(Movement new_state);
virtual void SetState(Status new_state);
virtual void SetWeapon(Weapon new_weapon);
void AddCarPoints();
static int SetCarStartPosition(int velocity = 0, bool top = false);
fPoint GetPivot();
void TurnRandom();
Weapon weapon;
CARS car_type;
Animation idle;
SDL_Rect right;
SDL_Rect left;
Animation crash;
fPoint position;
fPoint last_position;
Movement moving = STRAIGHT;
Status state = IDLE;
Timer clock;
Collider* mask;
float velocity;
bool to_delete;
//if is pushed by player
bool pushed;
private:
};
#endif // __MODULECARS_H__