Init commit
This commit is contained in:
commit
83e6c9e1f0
41 changed files with 1455 additions and 0 deletions
36
code-samples/frogger/src/frogger.c
Normal file
36
code-samples/frogger/src/frogger.c
Normal file
|
|
@ -0,0 +1,36 @@
|
|||
#include "frogger.h"
|
||||
|
||||
int main(void)
|
||||
{
|
||||
WIN_INIT(50);
|
||||
setlocale(LC_ALL, "");
|
||||
print_overlay();
|
||||
game_loop();
|
||||
endwin();
|
||||
|
||||
return SUCCESS;
|
||||
}
|
||||
|
||||
void game_loop()
|
||||
{
|
||||
board_t map;
|
||||
game_stats_t stats;
|
||||
player_pos frog;
|
||||
|
||||
bool break_flag = TRUE;
|
||||
int signal = 0;
|
||||
frog_state state = START;
|
||||
|
||||
stats_init(&stats);
|
||||
|
||||
while (break_flag)
|
||||
{
|
||||
if (state == GAMEOVER || state == EXIT_STATE)
|
||||
break_flag = FALSE;
|
||||
|
||||
sigact(get_signal(signal), &state, &stats, &map, &frog);
|
||||
|
||||
if (state == MOVING || state == START)
|
||||
signal = GET_USER_INPUT;
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue