-
Notifications
You must be signed in to change notification settings - Fork 10
/
invaders.h
84 lines (71 loc) · 2.21 KB
/
invaders.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
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
/**
* ascii invaders - A curses clone of the classic video game Space Invaders
* (c) 2001 Thomas Munro
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
* https://github.com/macdice/ascii-invaders
* Thomas Munro <[email protected]>
*
* $Id: invaders.h,v 1.3 2002/07/21 21:52:14 munro Exp $
*/
struct Bomb {
int x;
int y;
int anim;
struct Bomb *next;
};
typedef struct Sprite {
const char *lines[4];
} Sprite;
/* To make this compile under Darwin/BSD I have to comment these, until
I figure out how to fix this problem (may involve not using apple's curses
implementation). */
#define USE_COLORS 1
#define USE_KEYS 1
//#define BULLET_PROOF 1 // debug
#define BOMB_ANIM_SIZE 4 // "frames" in bomb anim
#define FPS 15 // frames per second
#define PAINT_WAIT 2 // how many frames between row repaints
#define ASCII 0
#define UNICODE 1
/* Sprites. */
#define SHELTER 8
#define ALIEN_EXPLODE 7
#define GUNNER_EXPLODE 6
#define GUNNER 5
#define MA 4
#define ALIEN30 3
#define ALIEN20 2
#define ALIEN10 1
/* Special alien table values. */
#define ALIEN_EMPTY 0
#define ALIEN_EXPLODE1 -1
#define ALIEN_EXPLODE2 -2
#define ALIEN_WIDTH 6
#define ALIEN_HEIGHT 3
#define GUNNER_WIDTH 7
#define GUNNER_HEIGHT 2
#define SHELTER_WIDTH 7
#define SHELTER_HEIGHT 3
#define MA_HEIGHT 2
#define MA_WIDTH 6
#define GUNNER_ENTRANCE 40 // how many frames before gunner appears
#define MA_ENTRANCE 400 // how many frames before MA comes on the screen
#define STATE_INTRO 1
#define STATE_PLAY 2
#define STATE_EXPLODE 3
#define STATE_WAIT 4
#define STATE_GAMEOVER 5