tb1/playgame.c

65 lines
1.9 KiB
C
Raw Normal View History

2000-09-16 23:23:00 +00:00
#include <stdio.h>
#include "svmwgraph/svmwgraph.h"
#include "tb1_state.h"
#include "tblib.h"
2000-09-17 05:47:00 +00:00
#include "graphic_tools.h"
2000-09-16 23:23:00 +00:00
#include "levels.h"
2000-09-17 05:47:00 +00:00
#include "hiscore.h"
2000-09-16 23:23:00 +00:00
2000-09-17 05:47:00 +00:00
void playthegame(tb1_state *game_state)
2000-09-16 23:23:00 +00:00
{
2000-09-17 05:47:00 +00:00
int lowscore;
char *hiname;
2000-09-16 23:23:00 +00:00
if (game_state->level==0) {
littleopener(game_state);
game_state->shields=12;
game_state->score=0;
game_state->level++;
}
if (game_state->level==1) {
2000-09-17 05:47:00 +00:00
levelone(game_state);
2000-09-18 03:50:00 +00:00
if (game_state->level==2) littleopener2(game_state);
2000-09-16 23:23:00 +00:00
}
if (game_state->level==2) {
2000-09-17 05:47:00 +00:00
leveltwoengine(game_state);
2000-09-16 23:23:00 +00:00
}
if (game_state->level==3) {
/*littleopener3();
levelthree();*/
}
if (game_state->level==4) {
// leveltwoengine(&level,&shields,&score);
}
coolbox(70,85,170,110,1,game_state->virtual_1);
vmwTextXY("GAME OVER",84,95,4,7,0,
game_state->graph_state->default_font,game_state->virtual_1);
game_state->level=0;
vmwBlitMemToDisplay(game_state->graph_state,game_state->virtual_1);
vmwClearKeyboardBuffer();
2000-09-17 05:47:00 +00:00
pauseawhile(10);
lowscore=showhiscore(game_state,0,0);
if (game_state->score >lowscore) {
coolbox(10,75,310,125,1,game_state->virtual_1);
vmwTextXY("NEW HIGH SCORE!",90,80,12,7,0,game_state->graph_state->default_font,
game_state->virtual_1);
vmwTextXY("ENTER YOUR NAME (10 Chars)",30,90,0,7,0,
game_state->graph_state->default_font,game_state->virtual_1);
vmwBlitMemToDisplay(game_state->graph_state,game_state->virtual_1);
2000-09-18 03:50:00 +00:00
hiname=vmwGrInput(game_state,110,110,10,11,0,game_state->graph_state->default_font,
2000-09-17 05:47:00 +00:00
game_state->virtual_1);
write_hs_list(game_state,game_state->score,hiname,0);
}
showhiscore(game_state,1,0);
vmwBlitMemToDisplay(game_state->graph_state,game_state->virtual_1);
vmwClearKeyboardBuffer();
2000-09-16 23:23:00 +00:00
pauseawhile(20);
}