[go: up one dir, main page]

Menu

[r58]: / tags / v1.0.3 / atomcore.h  Maximize  Restore  History

Download this file

52 lines (42 with data), 1.6 kB

 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
/*
*
*
*/
#ifndef atomcore_h_sentinel
#define atomcore_h_sentinel
#define field_free 128
#define field_atom 64
#define field_wall 192
#define field_type 192
#define field_index 63
#define ATOMIX_SRC_FILE 1
#define ATOMIX_SRC_MEM 2
struct atomixgame {
unsigned char field_width;
unsigned char field_height;
unsigned char solution_width;
unsigned char solution_height;
unsigned char field[64][64]; /* every byte is composed of few parts: ffiiiiii where ff are type flags, and iiiiii is the index */
unsigned char solution[32][32];
unsigned char cursorx;
unsigned char cursory;
unsigned char cursorstate; /* 0 = normal cursor / 1 = selected cursor */
int level;
time_t time_end;
unsigned int duration;
int offseth;
int offsetv;
char level_desc_line1[16];
char level_desc_line2[16];
unsigned char cursortype; /* 0 = normal cursor / 1 = bonus-like cursor */
int bg;
int score;
int hiscore;
};
struct atomixgame *atomix_initgame();
void atomix_loadgame(struct atomixgame *game, int level, int source, int *hiscores);
/* returns the distance that the block at position x/y would travel if pushed into 'direction'. direction is 0: up / 1: right / 2: down / 3: left */
int atomix_getmovedistance(struct atomixgame *game, int direction);
/* compares two games - the first is the playfield and the second is the expected solution. Returns 0 if game is not done, non-zero otherwise. */
int atomix_checksolution(struct atomixgame *game);
#endif