f7464a11629236286d8fe7078f916bbbb48fba07
[supertux.git] / src / gameloop.h
1 /*
2   gameloop.h
3   
4   Super Tux - Game Loop!
5   
6   by Bill Kendrick
7   bill@newbreedsoftware.com
8   http://www.newbreedsoftware.com/supertux/
9   
10   April 11, 2000 - Junuary 1st, 2004
11 */
12
13 #if !defined( SUPERTUX_GAMELOOP_H )
14 #define SUPERTUX_GAMELOOP_H 1
15
16 #include "sound.h"
17 #include "type.h"
18
19 /* Bounciness of distros: */
20
21 #define NO_BOUNCE 0
22 #define BOUNCE 1
23
24
25 /* One-ups... */
26
27 #define DISTROS_LIFEUP 100
28
29
30 /* Upgrade types: */
31
32 enum {
33   UPGRADE_MINTS,
34   UPGRADE_COFFEE,
35   UPGRADE_HERRING
36 };
37
38 /* Array sizes: */
39
40 #define NUM_BOUNCY_DISTROS 8
41 #define NUM_BROKEN_BRICKS 32
42 #define NUM_BOUNCY_BRICKS 4
43 #define NUM_FLOATING_SCORES 6
44 #define NUM_UPGRADES 2
45
46
47 /* Scores: */
48
49 #define SCORE_BRICK 5
50 #define SCORE_DISTRO 25
51
52 /* Function prototypes: */
53
54 int gameloop(void);
55 void savegame(void);
56 void loadgame(char* filename);
57 int issolid(float x, float y);
58 int isbrick(float x, float y);
59 int isice(float x, float y);
60 int isfullbox(float x, float y);
61 int rectcollision(itop_type* one, itop_type* two);
62 void drawshape(float x, float y, unsigned char c);
63 unsigned char shape(float x, float y);
64 void bumpbrick(float x, float y);
65 void trygrabdistro(float x, float y, int bounciness);
66 void trybreakbrick(float x, float y);
67 void tryemptybox(float x, float y);
68 void trybumpbadguy(float x, float y);
69 void add_bouncy_distro(float x, float y);
70 void add_broken_brick(float x, float y);
71 void add_broken_brick_piece(float x, float y, float xm, float ym);
72 void add_bouncy_brick(float x, float y);
73 void add_bad_guy(float x, float y, int kind);
74 void add_upgrade(float x, float y, int kind);
75 void add_bullet(float x, float y, float xm, int dir);
76 #endif
77