-
Notifications
You must be signed in to change notification settings - Fork 0
/
ModulePlayers.h
43 lines (32 loc) · 1.04 KB
/
ModulePlayers.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
#ifndef __MODULEPLAYERS_H__
#define __MODULEPLAYERS_H__
#include "Globals.h"
#include "Module.h"
enum playerSpawnDirection{
PSDIRECTION_UP = 0, PSDIRECTION_DOWN, PSDIRECTION_LEFT, PSDIRECTION_RIGHT
};
struct ModulePlayer;
struct Collider;
class ModulePlayers : public Module
{
public:
ModulePlayers(bool start_enabled = true);
~ModulePlayers();
update_status PreUpdate();
update_status Update();
update_status PostUpdate();
bool CleanUp();
void OnCollision(Collider* c1, Collider* c2);
ModulePlayer* players[4];
int playerJoinButton[4];
void playerDies(ModulePlayer* player);
void onTimeFunction(TimeFunction* timeFunction);
private:
//Adjusts the camera given the players position
void adjustCamera();
//Used for player joining
int playerJoining = 0; //What players is joining. 0 is no one, as the player one is always on.
Collider* playerJoinSpawnPoints[4]; //Temporal Spawn Collisions to check where the new player can join
void joinPlayer(const int i); //Common routines on all joinings
};
#endif // __MODULEPLAYERS_H__