-
Notifications
You must be signed in to change notification settings - Fork 0
/
aliens.h
59 lines (45 loc) · 1.06 KB
/
aliens.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
/* This file is part of Alienwave, a game by Alessandro Pira */
#ifndef _ALIENS_H
#define _ALEINS_H
#define AT_NONE -1
#define AT_LAST -2
#define AT_BIG_EXP 8
#define AT_LIT_EXP 7
#define AT_XSARNA_1 6
#define AT_XSARNA_2 5
#define AT_TINY 4
#define AT_SLIME 3
#define AT_BALL 2
#define AT_BIG 1
#define AT_LITTLE 0
#define MAX_HEIGHT 5
typedef char bitmask[MAX_HEIGHT];
typedef struct
{
int x;
int y;
int type; // See #defines up there
void (*blit)(int,int);
void (*clear)(int,int);
void (*move)(void *);
short int state;
bitmask collide;
} alien;
#define NUM_ALIENS 10
/* Alien movement */
void move_alien_straight(void *);
void move_alien_oscillate(void *);
void move_alien_serpent(void *);
void move_alien_diagonal(void *);
void init_aliens();
/* Draws all aliens */
void blit_aliens();
/* Deletes all aliens */
void delete_aliens();
/* Makes all aliens move */
void move_aliens();
/* Blows alien num and update score */
void blow_alien(int);
/* Check collisions for all aliens */
int collide_aliens(int, int);
#endif //_ALIENS_H