forked from NiliusJulius/Alien-Invasion
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtypedefs.h
56 lines (50 loc) · 1.11 KB
/
typedefs.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
#ifndef _TYPEDEFS
#define _TYPEDEFS
#include <stdint.h>
#include <stdbool.h>
#include "bcd.h"
// Player
typedef struct Player {
uint8_t sprite_count;
uint8_t sprite_index;
uint8_t location[2];
uint8_t time_since_animation_start;
uint8_t time_since_last_moved;
uint8_t move_speed_delay;
bool can_move;
bool can_shoot;
} player_t;
// Player bullet
typedef struct Bullet {
uint8_t sprite_count;
uint8_t sprite_index;
uint8_t location[2];
uint8_t speed;
uint8_t sprite_left_offset;
uint8_t sprite_right_offset;
uint8_t sprite_top_offset;
uint8_t sprite_bottom_offset;
} bullet_t;
typedef struct Enemy {
uint8_t sprite_index;
uint8_t tile_index;
uint8_t location[2];
uint8_t sprite_left_offset;
uint8_t sprite_right_offset;
uint8_t sprite_top_offset;
uint8_t sprite_bottom_offset;
bool top_enemy;
bool bottom_enemy;
bool destroyed;
BCD value;
uint8_t bullet_cooldown;
uint8_t bullet_timer;
uint8_t bullet_type;
} enemy_t;
typedef struct Explosion {
uint8_t sprite_index;
uint8_t location[2];
uint8_t time_since_animation_start;
uint8_t is_on_screen;
} explosion_t;
#endif