X-Git-Url: http://vcs.maemo.org/git/?a=blobdiff_plain;f=ball%2Flevel.h;h=92f971ad42699f255e424077dcf53c4103be9fbb;hb=4438862ba8c07519eff35ebf65e55f5a8f221ee3;hp=74e244226b2814510306273e96ab14ba94745a04;hpb=659a8bdbad173168000ed0a1e7582c58246e146f;p=neverball diff --git a/ball/level.h b/ball/level.h index 74e2442..92f971a 100644 --- a/ball/level.h +++ b/ball/level.h @@ -2,19 +2,8 @@ #define LEVEL_H #include "base_config.h" -#define NSCORE 3 - -/*---------------------------------------------------------------------------*/ - -struct score -{ - char player[NSCORE + 1][MAXNAM]; - - int timer [NSCORE + 1]; /* Time elapsed */ - int coins [NSCORE + 1]; /* Coins collected */ -}; - -void score_init_hs(struct score *, int, int); +#include "score.h" +#include "levels.h" /*---------------------------------------------------------------------------*/ @@ -28,7 +17,6 @@ struct level char message[MAXSTR]; - char levelname[MAXSTR]; char version[MAXSTR]; char author[MAXSTR]; @@ -48,62 +36,30 @@ struct level struct set *set; int number; - char repr[3]; /* String representation of the number (eg. "B1") */ + + /* String representation of the number (eg. "IV") */ + char repr[MAXSTR]; int is_locked; int is_bonus; int is_completed; }; -int level_load(const char *, struct level *); - -void level_dump_info(const struct level *); - -/*---------------------------------------------------------------------------*/ +int level_load(const char *, struct level *); +void level_dump(const struct level *); -/* A level for the playing */ - -struct level_game -{ - int mode; /* game mode */ - const struct level *level; /* the level played */ - - int goal; /* coins needed */ - int time; /* time limit */ - - /* MODE_CHALLENGE only */ - int score; /* coin total */ - int balls; /* live count */ - int times; /* time total */ - - /* Once a level is finished */ - int state; /* state ending */ - int coins; /* coins collected */ - int timer; /* time elapsed */ - int state_value; /* more precision about the state: skip for goal */ - - /* rank = 3 => unclassed */ - int coin_rank; /* rank in the level high-scores */ - int goal_rank; /* rank in the level high-scores */ - int time_rank; /* rank in the level high-scores */ - int score_rank; /* rank in the set high-scores */ - int times_rank; /* rank in the set high-scores */ - - /* What about the game and the set? */ - int dead; /* Is the game over and lost? */ - int win; /* Is the game over and win? */ - int unlock; /* Is the next level newly unlocked */ - const struct level *next_level; /* next level (NULL no next level) */ -}; +int level_replay(const char *); +int level_play(const struct level *, int); +void level_stat(int, int, int); +void level_stop(void); +int level_next(void); +int level_same(void); /*---------------------------------------------------------------------------*/ -#define MODE_CHALLENGE 1 -#define MODE_NORMAL 2 -#define MODE_PRACTICE 3 -#define MODE_SINGLE 4 +int count_extra_balls(int, int); -const char *mode_to_str(int); +void level_update_player_name(void); /*---------------------------------------------------------------------------*/ @@ -111,8 +67,7 @@ const char *mode_to_str(int); #define GAME_TIME 1 /* Time's up */ #define GAME_GOAL 2 /* Goal reached */ #define GAME_FALL 3 /* Fall out */ -#define GAME_SPEC 4 /* Special goal reached */ -const char *state_to_str(int); +const char *status_to_str(int); #endif