JasonWoof Got questions, comments, patches, etc.? Contact Jason Woofenden
made bang dots hit rocks, removed blast_rocks function.
[vor.git] / globals.h
1 #ifndef VOR_GLOBALS_H
2 #define VOR_GLOBALS_H
3
4 #include <SDL.h>
5 #include <inttypes.h>
6 #include "SFont.h"
7
8 struct bangdots {
9         // Bang dots have the same colour as shield dots.
10         // Bang dots get darker as they age.
11         // Some are coloured the same as the ex-ship.
12         float x,y,dx,dy;
13         Uint16 c; // when zero, use heatcolor[bangdotlife]
14         float life;     // When reduced to 0, set active = 0
15         int active;
16         float decay;// Amount by which to reduce life each time dot is drawn
17 };
18 struct enginedots {
19         // Engine dots stream out the back of the ship, getting darker as they go.
20         int active;
21         float x,y,dx,dy;
22         // The life of an engine dot 
23         // is a number starting at between 0 and 50 and counting backward.
24         float life;     // When reduced to 0, set active = 0
25 };
26
27 // ************************************* VARS
28 // SDL_Surface global variables
29 extern SDL_Surface 
30         *surf_screen,   // Screen
31         *surf_b_variations, // "variations" banner
32         *surf_b_on, // "on" banner
33         *surf_b_rockdodger, // "rockdodger" banner
34         *surf_b_game,   // Title element "game"
35         *surf_b_over,   // Title element "over"
36         *surf_ship,             // Spaceship element
37         *surf_life,     // Indicator of number of ships remaining
38         *surf_rock[NROCKS],     // THE ROCKS
39         *surf_font_big; // The big font
40
41 extern SFont_Font *g_font;
42
43 // Structure global variables
44 extern struct enginedots edot[MAXENGINEDOTS], *dotptr;
45 extern struct bangdots bdot[MAXBANGDOTS], *bdotptr;
46
47 // Other global variables
48 extern char topline[1024];
49 extern char *initerror;
50
51 extern float screendx, screendy;
52
53 // All movement is based on t_frame.
54 // All speeds are pixels/tick, with 20 ticks per second.
55 extern float t_frame;  // length of this frame (in ticks = 1/20th second)
56
57 extern int score;
58 extern int g_easy;
59 extern float fadetimer, faderate;
60
61 extern int pausedown, paused;
62
63 // bangdot start (bd1) and end (bd2) position:
64 extern int bd1, bd2;
65
66 extern int bangdotlife, nbangdots;
67 extern Uint16 heatcolor[W*3];
68
69 extern char *data_dir;
70
71 extern uint32_t initial_rocks, final_rocks;
72
73 #endif // VOR_GLOBALS_H