-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathobjects.h
More file actions
56 lines (47 loc) · 1.31 KB
/
Copy pathobjects.h
File metadata and controls
56 lines (47 loc) · 1.31 KB
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
#ifndef OBJECTS_H
#define OBJECTS_H
#include <SDL.h>
#include "constans.h"
struct Player {
SDL_Rect position;
SDL_Texture *texture;
int left, right, up, down, powerA;
int powerup_pos_arrx[MAX_POWERUP];
int powerup_pos_arry[MAX_POWERUP];
int map_array[15][20];
int can_jump, y_speed;
int face, shoot, reloading;
int rand_num;
//int powerupA_active;
//int powerupB_active;
//int powerupA_time_elapsed;
//int powerupB_time_elapsed;
unsigned int powerupA_start_time;
unsigned int powerupB_start_time;
unsigned int powerupC_start_time;
//unsigned int
int left_key, right_key, up_key, down_key, attack_key, powerA_key;
int powerup_a;
int powerup_b;
int powerup_c;
int win;
int kills, deaths;
};
struct Bullet {
SDL_Rect position;
int face;
int player_id;
};
struct PowerUp {
SDL_Rect position;
int powerup_type;
int player_id;
};
struct Player players[MAX_PLAYERS];
void resolve_player_key_up(int key, struct Player* player);
void resolve_player_key_down(int key, struct Player* player);
void resolve_keyboard(SDL_Event e, struct Player* player);
void set_player_pos(struct Player* player, float x, float y);
struct Bullet init_bullet(int x, int y, int face);
struct PowerUp init_powerup(int x, int y, int taken);
#endif