-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathentities.h
More file actions
36 lines (29 loc) · 950 Bytes
/
entities.h
File metadata and controls
36 lines (29 loc) · 950 Bytes
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
#ifndef ENTITIES_H
#define ENTITIES_H
#include <raylib.h>
typedef struct Player {
int id;
Vector2 position;
Vector2 velocity;
Texture2D *texture;
int wasOnGround;
} Player;
Player createPlayer(int type, Texture2D *texture);
void deletePlayer(Player *player);
void inputPlayer(Player *player);
void moveAndCheckPlayer(Player *player, int *levelDim, int *floors, int *walls);
typedef struct Grenade {
int id;
Vector2 position;
Vector2 velocity;
Texture2D *texture;
Player *owner;
unsigned char bounces;
char dead;
} Grenade;
Grenade createGrenade(int id, Player *owner, Texture2D *texture);
void deleteGrenade(Grenade *grenade);
void updateGrenade(Grenade *grenade, int *levelDim, int *floors, int *walls);
int storeGrenade(Grenade *array, char arraySize, char *takenIndices, Grenade *obj);
Grenade *unstoreGrenade(Grenade *array, char arraySize, char *takenIndices, int id);
#endif // ENTITIES_H