again more code clean, thing become more and more simpler
[neverball] / ball / level.h
1 #ifndef LEVEL_H
2 #define LEVEL_H
3
4 #include "base_config.h"
5
6 /*---------------------------------------------------------------------------*/
7
8 /* A simple level */
9
10 struct level
11 {
12     /* (data) means that the file is relative from the data file */
13     char file[MAXSTR];    /* sol main file */
14     char back[MAXSTR];    /* sol background file (data) */
15     char grad[MAXSTR];    /* gradiant backgound image (data) */
16     char shot[MAXSTR];    /* screenshot image (data)*/
17     char song[MAXSTR];    /* song file (data) */
18     int  time;            /* time limit */
19     int  goal;            /* coins needed */
20 };
21
22 int level_load(const char *, struct level *);
23
24 void level_dump_info(const struct level *);
25
26 /*---------------------------------------------------------------------------*/
27
28 /* A level for the playing */
29
30 struct level_game
31 {
32     int mode;          /* game mode */
33     int level;         /* level id of the set */
34
35     int goal;          /* coins needed */
36     int time;          /* time limit */
37     
38     /* MODE_CHALLENGE only */
39     int score;         /* coin total */
40     int balls;         /* live count */
41     int times;         /* time total */
42
43     /* Once a level is finished */
44     int state;         /* state ending */
45     int coins;         /* coins collected */
46     int timer;         /* time elapsed */
47 };
48
49 /*---------------------------------------------------------------------------*/
50
51 #define MODE_CHALLENGE  1
52 #define MODE_NORMAL     2
53 #define MODE_PRACTICE   3
54 #define MODE_SINGLE     4
55
56 const char *mode_to_str(int);
57
58 #endif