tb1/tb1_linux/playgame.c

71 lines
2.2 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"
2001-10-29 06:18:00 +00:00
#include "level2_engine.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) {
2000-11-02 06:45:00 +00:00
LevelOneLittleOpener(game_state);
2000-09-16 23:23:00 +00:00
game_state->shields=12;
game_state->score=0;
game_state->level++;
}
if (game_state->level==1) {
2000-11-02 06:45:00 +00:00
LevelOneEngine(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) {
2001-10-29 06:18:00 +00:00
leveltwoengine(game_state,"level1/ships.tb1","level2/level2.dat",
"level2/tbaship.tb1"," LEVEL TWO:",
2004-09-26 19:18:00 +00:00
"THE \"PEACE ENVOY\"",NULL);
2000-11-02 06:45:00 +00:00
if (game_state->level==3) LevelThreeLittleOpener(game_state);
2000-09-16 23:23:00 +00:00
}
if (game_state->level==3) {
2000-11-02 06:45:00 +00:00
LevelThreeEngine(game_state);
2000-09-16 23:23:00 +00:00
}
if (game_state->level==4) {
2001-10-29 06:18:00 +00:00
leveltwoengine(game_state,"level1/ships.tb1","level4/level4.dat",
"level4/tbeerm.tb1"," LEVEL FOUR:"," THE PLANET EERM",
NULL);
2000-09-16 23:23:00 +00:00
}
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);
}