summaryrefslogtreecommitdiff
path: root/noncore/games/kbill/Game.h
blob: 44739363ab91f6e4afa2fe34483735a965ef08c1 (plain)
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
#ifndef GAME_H
#define GAME_H

#include "objects.h"

class Game {
	unsigned state;
	int efficiency;
public:
	unsigned score, level, iteration;
	Picture logo;
	int grabbed;

	static const unsigned short scrwidth = 240;
	static const unsigned short scrheight = 290;

	static const int PLAYING = 1;
	static const int BETWEEN = 2;
	static const int END = 3;
	static const int WAITING = 4;

	static const int DEFAULTC = 0;		/* cursors */
	static const int DOWNC = -1;
	static const int BUCKETC = -2;

	static const int ENDGAME = 200;		/* dialog window IDs */
	static const int ENTERNAME = 201;
	static const int HIGHSCORE = 202;
	static const int SCORE = 203;

	static const int ENDLEVEL = -1;		/* Codes for updating score */
	static const int BILLPOINTS = 5;

	static const int EMPTY = -2;		/* Grabbed object */
	static const int BUCKET = -1;

	int RAND(int lb, int ub);
	int MAX(int x, int y);
	int MIN(int x, int y);
	int INTERSECT(int x1, int y1, int w1, int h1, int x2, int y2, int w2,
		int h2);

	void setup_level (unsigned int lev);
	void start(unsigned int lev);
	void quit();
	void update_info();
	void update_score (int action);
	void warp_to_level (unsigned int lev);
	void button_press(int x, int y);
	void button_release(int x, int y);
	void update();
	void main(int argc, char **argv);
};

#endif