mirror of
https://github.com/gwenhael-le-moine/c-urs_-toil-s.git
synced 2024-12-27 09:58:44 +01:00
display a end-game message
This commit is contained in:
parent
02795db58a
commit
73717a08a0
1 changed files with 52 additions and 35 deletions
87
star.c
87
star.c
|
@ -553,7 +553,7 @@ int parse_args( int argc, char* argv[], struct options *o, struct state *s )
|
||||||
*/
|
*/
|
||||||
int main( int argc, char* argv[] )
|
int main( int argc, char* argv[] )
|
||||||
{
|
{
|
||||||
int key;
|
int key, over = 0;
|
||||||
struct state *s = malloc( sizeof( struct state ) );
|
struct state *s = malloc( sizeof( struct state ) );
|
||||||
struct options *o = malloc( sizeof( struct options ) );
|
struct options *o = malloc( sizeof( struct options ) );
|
||||||
|
|
||||||
|
@ -592,43 +592,48 @@ int main( int argc, char* argv[] )
|
||||||
load_level( s, levels, s->level + 1 );
|
load_level( s, levels, s->level + 1 );
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
// TODO:Damn it you finished the whole game!!
|
over = 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
display_level( s );
|
if ( over == 0 ) {
|
||||||
key = getch();
|
display_level( s );
|
||||||
switch( key ) {
|
key = getch();
|
||||||
case KEY_UP:
|
switch( key ) {
|
||||||
make_a_move( s, UP );
|
case KEY_UP:
|
||||||
break;
|
make_a_move( s, UP );
|
||||||
case KEY_DOWN:
|
break;
|
||||||
make_a_move( s, DOWN );
|
case KEY_DOWN:
|
||||||
break;
|
make_a_move( s, DOWN );
|
||||||
case KEY_LEFT:
|
break;
|
||||||
make_a_move( s, LEFT );
|
case KEY_LEFT:
|
||||||
break;
|
make_a_move( s, LEFT );
|
||||||
case KEY_RIGHT:
|
break;
|
||||||
make_a_move( s, RIGHT );
|
case KEY_RIGHT:
|
||||||
break;
|
make_a_move( s, RIGHT );
|
||||||
case ' ':
|
break;
|
||||||
switch_actor( s );
|
case ' ':
|
||||||
break;
|
switch_actor( s );
|
||||||
case 'n':
|
break;
|
||||||
if ( s->level < s->nb_levels - 1 ) {
|
case 'n':
|
||||||
load_level( s, levels, s->level + 1 );
|
if ( s->level < s->nb_levels - 1 ) {
|
||||||
}
|
load_level( s, levels, s->level + 1 );
|
||||||
break;
|
}
|
||||||
case 'p':
|
break;
|
||||||
if ( s->level > 0 ) {
|
case 'p':
|
||||||
load_level( s, levels, s->level - 1 );
|
if ( s->level > 0 ) {
|
||||||
}
|
load_level( s, levels, s->level - 1 );
|
||||||
break;
|
}
|
||||||
case 'r':
|
break;
|
||||||
load_level( s, levels, s->level );
|
case 'r':
|
||||||
break;
|
load_level( s, levels, s->level );
|
||||||
default:
|
break;
|
||||||
break;
|
default:
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
key = 'q';
|
||||||
}
|
}
|
||||||
} while( ( s->level < s->nb_levels ) && (( key != 'q' ) && ( key != 'Q' )) );
|
} while( ( s->level < s->nb_levels ) && (( key != 'q' ) && ( key != 'Q' )) );
|
||||||
|
|
||||||
|
@ -640,5 +645,17 @@ int main( int argc, char* argv[] )
|
||||||
nocbreak();
|
nocbreak();
|
||||||
endwin();
|
endwin();
|
||||||
|
|
||||||
|
if ( over == 1 ) {
|
||||||
|
printf( "################################\n" );
|
||||||
|
printf( "## ##\n" );
|
||||||
|
printf( "## You've finished the whole ##\n" );
|
||||||
|
printf( "## game! ##\n" );
|
||||||
|
printf( "## ##\n" );
|
||||||
|
printf( "## Now it's your turn to ##\n" );
|
||||||
|
printf( "## contribute new levels ;) ##\n" );
|
||||||
|
printf( "## ##\n" );
|
||||||
|
printf( "################################\n" );
|
||||||
|
}
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue