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