-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathplayer.h
67 lines (56 loc) · 1.13 KB
/
player.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
61
62
63
64
65
66
67
#define START_LIVES 9
#define START_BOMBS 2
#define START_POWER 0
#define FIREDELAY 1
#define MAX_BULLETS 26
/*
Manages the player and the bullets that they shoot
*/
/*
Player struct that contain all relevant player information
*/
typedef struct Player {
unsigned int lives;
int r;
int c;
int size;
unsigned int numBombs;
unsigned int power;
unsigned int speed;
int speed_slow_factor;
} Player;
/*
Initializes the player
*/
void player_init();
/*
Handles player movement based on input
*/
void player_move();
/*
Creates a bullet object at the end of the bullets array
Fails to do so if max player has been reached
*/
void player_create_bullet(int r, int c);
/*
Updates all existing bullets position based on bullet speed
*/
void update_bullets();
/*
Allows player to fire based on player_fire_timer
*/
void update_fire();
/*
Initializes all of player's bullets to the corner of the map
*/
void player_bullet_init();
/*
Checks collision between the player and possible bullets
*/
int player_check_collision(int r, int c, int radius);
/*
Update player bullet sprites
*/
void player_update_sprites();
//primary player
extern Player player;