Skip to content

Commit

Permalink
new cheat: The 'c' key will open levels
Browse files Browse the repository at this point in the history
git-svn-id: https://s.snth.net/svn/neverball/trunk@59 78b8d119-cf0a-0410-b17c-f493084dd1d7
  • Loading branch information
mrtout committed Feb 16, 2006
1 parent 4e4e1d9 commit 432f733
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 5 deletions.
9 changes: 4 additions & 5 deletions ball/level.c
Expand Up @@ -26,8 +26,6 @@
#include "audio.h"
#include "config.h"

/*#define CHEATER 1*/

/*---------------------------------------------------------------------------*/

struct score
Expand Down Expand Up @@ -305,11 +303,12 @@ void level_init(const char *init_levels,
level_total = 0;
coins_total = 0;
times_total = 0;
}

#ifdef CHEATER
void level_cheat(void)
/* Open each level of the set */
{
limit = count;
level_store_hs(user_scores);
#endif
}

void level_free(void)
Expand Down
2 changes: 2 additions & 0 deletions ball/level.h
Expand Up @@ -48,6 +48,8 @@ void level_song(void);

int level_mode(void);

void level_cheat(void);

/*---------------------------------------------------------------------------*/

#endif
7 changes: 7 additions & 0 deletions ball/st_start.c
Expand Up @@ -23,6 +23,7 @@
#include "st_set.h"
#include "st_over.h"
#include "st_level.h"
#include "st_start.h"
#include "st_title.h"

/*---------------------------------------------------------------------------*/
Expand Down Expand Up @@ -230,6 +231,12 @@ static int start_keybd(int c, int d)
{
if (d && c == SDLK_ESCAPE)
return goto_state(&st_title);

if (d && c == SDLK_c)
{
level_cheat();
return goto_state(&st_start);
}

if (d && c == SDLK_F12)
{
Expand Down

0 comments on commit 432f733

Please sign in to comment.