Exemplo n.º 1
0
void HandleKeys()
{
	if(!_bGameOver && !_bDemo)
	{
		//Move the car based upon the left/right key presses
		POINT ptVelocity = _pCarSprite->GetVelocity();
		
		if (GetAsyncKeyState(VK_LEFT) < 0)
		{
			//Move left
			ptVelocity.x = max((int)ptVelocity.x -1, -4);
			_pCarSprite->SetVelocity(ptVelocity);
		}

		else if (GetAsyncKeyState(VK_RIGHT) < 0)
		{
			//Move right
			ptVelocity.x = min((int)ptVelocity.x + 2, 6);
			_pCarSprite->SetVelocity(ptVelocity);
		}

		//Fire missiles based upon spacebar presses
		if ((++_iFireInputDelay > 6) && GetAsyncKeyState(VK_SPACE) < 0)
		{
			//Create a new missile sprite
			RECT  rcBounds = { 0, 0, 600, 450 };
			RECT  rcPos = _pCarSprite->GetPosition();
			Sprite* pSprite = new Sprite(_pMissileBitmap, rcBounds, BA_DIE);
			pSprite->SetPosition(rcPos.left + 15, 400);
			pSprite->SetVelocity(0, -7);
			_pGame->AddSprite(pSprite);

			//Play the missile (fire) sounds
			PlaySound((LPCSTR)IDW_MISSILE, _hInstance, SND_ASYNC | 
				SND_RESOURCE | SND_NOSTOP);

			//reset the input delay
			_iFireInputDelay = 0;
		}
	}
	
	//Start a new game based upon an Enter (Return) key press
	if (GetAsyncKeyState(VK_RETURN) < 0)
		if (_bDemo)
		{
			//Start a new game without the splash screen
			_bDemo = FALSE;
			NewGame();
		}
		else if (_bGameOver)
		{	
			//Start a new game
			NewGame();
		}
}
Exemplo n.º 2
0
void CChineseChessView::OnLButtonUp(UINT nFlags, CPoint point)
{
	// TODO: ÔÚ´ËÌí¼ÓÏûÏ¢´¦Àí³ÌÐò´úÂëºÍ/»òµ÷ÓÃĬÈÏÖµ
	if (isMouseDown){
		isMouseDown=false;		
		CRect rect;
		GetClientRect(&rect);

		CPoint logpoint=PhysicalToLogicPoint(point);
		if (logpoint.x>=0){	
			//human move
			Gen();
			newmove.from = LogicPointToNum(selectedPoint); 
			newmove.dest = LogicPointToNum(logpoint);
			for (int i=gen_begin[ply]; i<gen_end[ply]; i++){
				if (gen_dat[i].m.from==newmove.from && gen_dat[i].m.dest==newmove.dest){
					if(UpdateNewMove()){
						UpdateDisplay(rect);
						int ret;
						ret=MessageBox("you are really a lucky dog,dare to try again?","Game Over",MB_YESNO);
						if (ret==IDYES){
							NewGame(true);
							return;
						}else{
							exit(0);
						}
					}
					side = xside; xside = 1-xside;
					//computer move
					short best;			
					best = AlphaBeta(-INFINITY, INFINITY, MAX_PLY);
					if(UpdateNewMove()){
						UpdateDisplay(rect);
						int ret;
						ret=MessageBox("afraid?dare to try again?","Game Over",MB_YESNO);
						if (ret==IDYES){
							NewGame(true);
							return;
						}else{
							exit(0);
						}
					}
					side = xside; xside = 1-xside;
					break;
				}
			}
			
		}

		UpdateDisplay(rect);
		
	}
	CView::OnLButtonUp(nFlags, point);
}
Exemplo n.º 3
0
void RecordDemo (void)
{
	int level,esc;

	CenterWindow(26,3);
	PrintY+=6;
	CA_CacheGrChunk(STARTFONT);
	fontnumber=0;
	US_Print("  Demo which level(1-10):");
	VW_UpdateScreen();
	VW_FadeIn ();
	esc = !US_LineInput (px,py,str,NULL,true,2,0);
	if (esc)
		return;

	level = atoi (str);
	level--;

	SETFONTCOLOR(0,15);
	VW_FadeOut ();

#ifndef SPEAR
	NewGame (gd_hard,level/10);
	gamestate.mapon = level%10;
#else
	NewGame (gd_hard,0);
	gamestate.mapon = level;
#endif

	StartDemoRecord (level);

	DrawPlayScreen ();
	VW_FadeIn ();

	startgame = false;
	demorecord = true;

	SetupGameLevel ();
	StartMusic ();
	PM_CheckMainMem ();
	fizzlein = true;

	PlayLoop ();

	demoplayback = false;

	StopMusic ();
	VW_FadeOut ();
	ClearMemory ();

	FinishDemoRecord ();
}
Exemplo n.º 4
0
void Run(UI* ui)
{   if(ui == NULL) return;
    NewGame(ui->game);
    NextTurn(ui->game);
    int c, running = 1;
    while(running && ui->game->status != GAME_STATUS_ERROR)
    {   DisplayGame(ui);
        c = getch();
        switch(c)
        {
        case KEY_LEFT:
            if(ui->game->status != GAME_STATUS_LOST)
            {	if(PushLeft(ui->game)) NextTurn(ui->game);
                else CheckTurn(ui->game);
            }
            break;
        case KEY_RIGHT:
            if(ui->game->status != GAME_STATUS_LOST)
            {	if(PushRight(ui->game)) NextTurn(ui->game);
                else CheckTurn(ui->game);
            }
            break;
        case KEY_UP:
            if(ui->game->status != GAME_STATUS_LOST)
            {	if(PushUp(ui->game)) NextTurn(ui->game);
                else CheckTurn(ui->game);
            }
            break;
        case KEY_DOWN:
            if(ui->game->status != GAME_STATUS_LOST)
            {	if(PushDown(ui->game)) NextTurn(ui->game);
                else CheckTurn(ui->game);
            }
            break;
        case 'q':
            running = 0;
            break;
        case 'n':
            NewGame(ui->game);
            NextTurn(ui->game);
            break;
        case 'r':
            StartGame(ui->game);
            NextTurn(ui->game);
            break;
        default:
            break;
        }
    }
}
Exemplo n.º 5
0
BOOL CALLBACK JumpDialogProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
{
	int n;

	switch (msg) {
	case WM_INITDIALOG:
		EnableLinkText(hwnd);
		SetDlgItemInt(hwnd, IDD_NUMBER, nMap + 1, FALSE);
		SendDlgItemMessage(hwnd, IDD_NUMBER + 1, UDM_SETBUDDY, (WPARAM)GetDlgItem(hwnd, IDD_NUMBER), 0);
		SendDlgItemMessage(hwnd, IDD_NUMBER + 1, UDM_SETRANGE, 0, MAKELONG(nMapMax + 1, 1));
		return TRUE;
	case WM_COMMAND:
		switch (wParam) {
		case IDOK:
			n = GetDlgItemInt(hwnd, IDD_NUMBER, NULL, FALSE);
			if (n >= 1 && n <= nMapMax + 1) {
				nMap = n - 1;
				NewGame(hwndMain, nMap);
			}
			;	// no break;
		case IDCANCEL:
			EndDialog(hwnd, 0);
			return TRUE;
		}
		break;
	case WM_CLOSE:
		EndDialog(hwnd,0);
		return 1;
	}
	return FALSE;
}
Exemplo n.º 6
0
int main(int argc, char** argv)
{
    char inbuf[256];
    char playerstring[1];
    int X,Y;

    turn = 0;
    fgets(inbuf, 256, stdin);
    if (sscanf(inbuf, "game %1s %d %d %d", playerstring, &depthlimit,
                &timelimit1, &timelimit2) != 4) error("Bad initial input");
    if (timelimit2 != 0) timelimit1 = timelimit2 / 64;
    if (timelimit1 == 0 && depthlimit == 0) depthlimit = 4;

    if (playerstring[0] == 'B') me = 1; else me = -1;
    NewGame();
    if (me == 1) MakeMove();
    while (fgets(inbuf, 256, stdin)!=NULL){
        if (strncmp(inbuf,"pass",4)!=0) {
            if (sscanf(inbuf, "%d %d", &X, &Y) != 2) return 0;
            Update(gamestate, -me, X, Y);
            if (debug) printboard(gamestate, -me, ++turn, X, Y);
        }
        MakeMove();
    }
    return 0;
}
Exemplo n.º 7
0
void MainWindow::on_pushButton_4_clicked()
{
    NewGame();
    /*
    qsrand(qrand());
    int money = qrand() % ((2 + 1) - 0) + 0;

    qDebug() << "Money " << money;

    for(int i = 0; i < doorList.count(); i++)
        doorList[i].SetWinner(false);

    doorList[money].SetWinner(true);

    CurrentStatus = 0;
    Round++;
    Correct = 0;
    Wrong = 0;
    Result = 0;

    ui->labelRound->setText(QString::number(Round) + "/10");

    UpdateStatus();

    ui->pushButtonDoorOne->setChecked(false);
    ui->pushButtonDoorTwo->setChecked(false);
    ui->pushButtonDoorThree->setChecked(false);*/
}
Exemplo n.º 8
0
int main() {

  int choix = 0, nb = 0;

  aff_Bienvenue();

  system("PAUSE");
  system("cls");

  aff_menuPrincipal();
  choix_Menu(&choix);

  switch (choix) {
  case 1:
    NewGame();
    break;
  case 2:
    nb = continuGame();
    break;
  case 3:
    nb = Quitter();
    break;
  }

  // printf("Votre choix vaut : %d", nb);
  return EXIT_SUCCESS;
}
Exemplo n.º 9
0
DGLE_RESULT DGLE_API Game::Initialize()
{
	pEngineCore->GetSubSystem(ESS_INPUT, (IEngineSubSystem *&)pInput);

	IRender *p_render;
	pEngineCore->GetSubSystem(ESS_RENDER, (IEngineSubSystem *&)p_render);
	p_render->SetClearColor(ColorWhite());
	p_render->GetRender2D(pRender2D);

	IResourceManager *p_res_man;
	pEngineCore->GetSubSystem(ESS_RESOURCE_MANAGER, (IEngineSubSystem *&)p_res_man);

	IEngineBaseObject *p_tmp_obj;

	p_res_man->GetDefaultResource(EOT_BITMAP_FONT, (IEngineBaseObject *&)pFont); // getting default font
	//p_res_man->Load(RESOURCE_PATH"\\fonts\\Times_New_Roman_12_rus.dft", (IEngineBaseObject *&)pFont, RES_LOAD_DEFAULT);

	p_res_man->Load(RESOURCE_PATH"\\sounds\\SwallowScore.wav", p_tmp_obj, RES_LOAD_DEFAULT, "SndSwallowScore");
	p_res_man->Load(RESOURCE_PATH"\\sounds\\SwallowBlackScore.wav", p_tmp_obj, RES_LOAD_DEFAULT, "SndSwallowBlackScore");
	p_res_man->Load(RESOURCE_PATH"\\sounds\\SwallowBigScore.wav", p_tmp_obj, RES_LOAD_DEFAULT, "SndSwallowBigScore");
	p_res_man->Load(RESOURCE_PATH"\\sounds\\SwallowHelpScore.wav", p_tmp_obj, RES_LOAD_DEFAULT, "SndSwallowHelpScore");
	p_res_man->Load(RESOURCE_PATH"\\sounds\\SwallowExit.wav", p_tmp_obj, RES_LOAD_DEFAULT, "SndSwallowExit");
	p_res_man->Load(RESOURCE_PATH"\\sounds\\SwallowGhost.wav", p_tmp_obj, RES_LOAD_DEFAULT, "SndSwallowGhost");
	p_res_man->Load(RESOURCE_PATH"\\sounds\\LostScore.wav", p_tmp_obj, RES_LOAD_DEFAULT, "SndLostScore");
	p_res_man->Load(RESOURCE_PATH"\\sounds\\IncreaseLives.wav", p_tmp_obj, RES_LOAD_DEFAULT, "SndIncreaseLives");

	NewGame();

	return S_OK;
}
Exemplo n.º 10
0
void RunGame( int load) {
    game g = NULL;
    if(load) {
        g = LoadGame();
    } else {
        g = NewGame();
    }
    if(g==NULL) {
        return;
    }
    wrefresh(g->arena);
    wrefresh(g->status);
    if(g!=NULL) {
        if(g->pc) g->print(g->pc);
        creature G = CreateCreature(g);
        G = g->ZombieListHead;
        while(G) {
            g->print(G->Character);
            G = G->Next;
        }
        PrintAllBuildings(g->gameMap, g->pc->pos);
        PlayLoop(g);
        if(G) {
            PurgeCreatureNode(G);
            DESTROY(G);
        }
        PurgeGame(g);
        DESTROY(g);
    }
}
void start_menu()
{
	printf("Menu:\n");
	printf("1. New Game\n");
	printf("2. Load Game\n");
	printf("Pilihan: ");
	int pilihan;
	read_with_limit(1, 2, &pilihan);
	if (pilihan == 1)
	{
		printf("Num of Player? ");
		read_with_limit(1, PLAYER_MAX, &pilihan);
		NewGame(pilihan);
		gamesystem_start();
	}
	else
	{
		Kata input;
		do
		{
			printf("Masukan kata kunci yang dipakai saat save game : "); BacaKata(&input);
			LoadGame(input);

		}while (FirstPetak(global.listOfPetak) == Nil);
		
		gamesystem_start();
	}
}
Exemplo n.º 12
0
// перемещает фишку из клетки, в которой сделан щелчок
// в свободную клетку
void __fastcall TForm1::Move(int cx, int cy)
{
    if  ( ( abs(cx - ex) == 1  &&  cy-ey == 0  ) ||
          ( abs(cy - ey) == 1  &&  cx-ex == 0  ) )
    {
        // переместить фишку из (cx,cy) в (ex,ey)
        pole[ey][ex] = pole[cy][cx];
        pole[cy][cx] = 16;
        ex = cx;
        ey = cy;
        // отрисовать поле
        ShowPole();
        if ( Finish () )
        {
            GameOver = true;
            ShowPole();
            int r = MessageDlg ("Цель достигнута! Еще раз (другая картинка)?",
                                mtInformation, TMsgDlgButtons() << mbYes << mbNo, 0);
            if ( r == mrNo )
                Form1->Close(); // завершить работу программы
            else
            {
                NewGame();
                ShowPole();
            }
        }
    }
}
Exemplo n.º 13
0
	void BotGameSet::TimerCheck(uint tick)
	{
		Common::ScopedLock<Common::Mutex> lk(_locker);
		std::map<uint, BotGame::Pointer>::iterator it;
		for(it = _games.begin(); it != _games.end(); ++ it)
		{
			if(it->second.get())
				it->second->TimerCheck(tick);
		}
		if(botCfg.AutoGame() && MapCfgPool::GetSingleton().GetCount() > 0)
		{
			MapCfg::Pointer cfg = MapCfgPool::GetSingleton()[botCfg.AutoDefMap()];
			if(cfg.get() == NULL)
				cfg = MapCfgPool::GetSingleton()[0];
			while(_games.size() < botCfg.AutoMaxCount())
			{
				static int counter = 0;
				++ counter;
				char numstr[128];
				sprintf(numstr, "%d", counter);
				if(!NewGame(botCfg.AutoName() + " #" + numstr, botCfg.AutoName(), cfg, cfg->GetDefaultReferee()))
					break;
			}
		}
	}
Exemplo n.º 14
0
int main(int argc, char *argv[])
{
	if( SDL_Init(SDL_INIT_AUDIO|SDL_INIT_VIDEO) < 0 ){
		printf("Unable to initialize SDL: %s\n", SDL_GetError());
		exit(1);
	}
	atexit(SDL_Quit);

	screen = SDL_SetVideoMode(SCREEN_WIDTH, SCREEN_HEIGHT, 32, SDL_HWSURFACE|SDL_HWPALETTE|SDL_DOUBLEBUF);
//	screen = SDL_SetVideoMode(800, 600, 32, SDL_SWSURFACE|SDL_HWPALETTE); //Slow


	if(screen == NULL)
	{
		printf("Unable to set 0x0 video: %s\n", SDL_GetError());
		exit(1);
	}

	Initialize();
	NewGame();
	Scorpion.DrawStaticScene();

	SDL_Event event;
	int done = 0;

	while(done == 0)
	{
		while(SDL_PollEvent(&event))
		{
			switch(event.type)
			{
				case SDL_QUIT:
     				return 0;

				case SDL_KEYDOWN:
     				if(event.key.keysym.sym == SDLK_ESCAPE) { done = 1; }
					HandleKeyDownEvent(event);
         			break;

				case SDL_MOUSEBUTTONDOWN:
					HandleMouseDownEvent(event);
  					break;

				case SDL_MOUSEMOTION:
					HandleMouseMoveEvent(event);
					break;

				case SDL_MOUSEBUTTONUP:
					HandleMouseUpEvent(event);
 					break;
			}
		}
	}

// perform cleaning up in here

	freeFont(font1);
	freeFont(font2);
	return 0;
}
Exemplo n.º 15
0
Arquivo: main.c Projeto: huangjs/cl
/***************************************************************
 Main function
***************************************************************/			
int main()
{
	srand(time(NULL));
	NewGame();
    InitGraphics();
	return 0;
}
Exemplo n.º 16
0
Arquivo: save.c Projeto: jawb/isola
void Load(char * name){
	FILE * f;
	int r,t[7],w,h,i;
	f = fopen(name,"rb");
	
	fread(&game.numplayers,sizeof(int),1,f);
	fread(&game.width,sizeof(int),1,f);
	fread(&game.height,sizeof(int),1,f);
	NewGame();
	fread(&game.turn,sizeof(int),1,f);
	fread(&game.step,sizeof(int),1,f);

	w = game.width;
	h = game.height;
	for(i=0;i<w;i++)
	{
		fread(game.board[i],sizeof(Cell),h,f);	
	}
	
	fread(game.players,sizeof(Player),game.numplayers,f);

	r = fread(t,sizeof(int),7,f);
	while(r == 7){
		AddHistory();
		game.history->pid = t[0];
		game.history->fx = t[1];
		game.history->fy = t[2];
		game.history->tx = t[3];
		game.history->ty = t[4];
		game.history->dx = t[5];
		game.history->dy = t[6];
		r = fread(t,sizeof(int),7,f);
	}
	fclose(f);
}
Exemplo n.º 17
0
void GameStart(HWND hWindow)
{
	srand(GetTickCount());

	g_hOffscreenDC = CreateCompatibleDC(GetDC(hWindow));
	g_hOffscreenBitmap = CreateCompatibleBitmap(GetDC(hWindow), g_pGame -> GetWidth(), g_pGame -> GetHeight());
	SelectObject(g_hOffscreenDC, g_hOffscreenBitmap);

	HDC hDC = GetDC(hWindow);
	
	g_pGroundBitmap = new Bitmap(hDC, IDB_GROUND, g_hInstance);
	g_pCityBitmap = new Bitmap(hDC, IDB_CITY, g_hInstance);
	g_pMeteorBitmap = new Bitmap(hDC, IDB_METEOR, g_hInstance);
	g_pBeamBitmap = new Bitmap(hDC, IDB_BEAM, g_hInstance);
	g_pExplosionBitmap = new Bitmap(hDC, IDB_EXPLOSION, g_hInstance);
	g_pGameOverBitmap = new Bitmap(hDC, IDB_GAMEOVER, g_hInstance);
	g_pShipBitmap = new Bitmap(hDC, IDB_SHIP, g_hInstance);
//	g_pBackBitmapTest = new Bitmap(hDC, IDB_BACK, g_hInstance);

//	g_pBackTest = new Background(g_pBackBitmapTest);
	g_pScrollingBackground = new ScrollingBackground(g_pGame -> GetWidth(), g_pGame -> GetHeight());
	g_pBackgroundLayer = new BackgroundLayer(hDC, IDB_BACK, g_hInstance, 5, SD_DOWN);
	RECT rcViewport;
	GetClientRect(g_pGame -> GetWindow(), &rcViewport);
	g_pBackgroundLayer -> SetViewport(rcViewport);
	g_pScrollingBackground -> AddLayer(g_pBackgroundLayer);

	g_pGame -> PlayMIDISong("D:\\Work\\C++\\testPJ\\MeteorDefense\\Res\\BGM.mid");

	NewGame();
}
Exemplo n.º 18
0
void MouseButtonDown(int x, int y, BOOL bLeft)
{	
/*	if(bLeft && !g_bGameOver)
	{
		RECT rcBounds = {0, 0, g_pGame -> GetWidth(), g_pGame -> GetHeight()};
		int iXpos = (x < 300) ? 144 : 449;
		Sprite * pSprite = new Sprite(g_pBeamBitmap, rcBounds, BA_DIE);
		pSprite -> SetNumFrames(3);
		pSprite -> SetPosition(iXpos, 365);

		int iXVel, iYVel = -6;
		y = min(y, 300);
		iXVel = (iYVel * (iXpos + 8 - x)) / (365 - y);
		pSprite -> SetVelocity(iXVel, iYVel);

		g_pGame -> AddSprite(pSprite);

		PlaySound(MAKEINTRESOURCE(IDW_SHOOT), NULL, SND_ASYNC | SND_RESOURCE);

		g_iScore = max(--g_iScore, 0);
	} 
	else*/ if(bLeft && g_bGameOver)
	{
		NewGame();
	}	
}	
Exemplo n.º 19
0
INT_PTR CALLBACK DifficultyDlgProc(HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
{
    switch (uMsg)
    {
    case WM_INITDIALOG:
        CheckRadioButton(hDlg, IDC_DIF_ONECOLOR, IDC_DIF_FOURCOLORS, IDC_DIF_ONECOLOR);
        return TRUE;

    case WM_COMMAND:
        switch(LOWORD(wParam))
        {
            case IDOK:
                if (IsDlgButtonChecked(hDlg, IDC_DIF_ONECOLOR) == BST_CHECKED)
                    dwDifficulty = IDC_DIF_ONECOLOR;
                else if (IsDlgButtonChecked(hDlg, IDC_DIF_TWOCOLORS) == BST_CHECKED)
                    dwDifficulty = IDC_DIF_TWOCOLORS;
                else if (IsDlgButtonChecked(hDlg, IDC_DIF_FOURCOLORS) == BST_CHECKED)
                    dwDifficulty = IDC_DIF_FOURCOLORS;

                NewGame();
                EndDialog(hDlg, TRUE);
                return TRUE;

            case IDCANCEL:
                EndDialog(hDlg, FALSE);
                return TRUE;
        }
        break;
    }
    return FALSE;
}
Exemplo n.º 20
0
Arquivo: main.c Projeto: huangjs/cl
void IncreaseHouses(void)
{
    if(number_houses < MAX_HOUSES)
    {
        number_houses++;
        NewGame();
    }
}
Exemplo n.º 21
0
Arquivo: main.c Projeto: huangjs/cl
void DecreaseHouses(void)
{
    if(number_houses > MIN_HOUSES)
    {
        number_houses--;
        NewGame();
    }
}
Exemplo n.º 22
0
int main(void)
{
	InfoPtr linfo;

	int pressedEnter = '0';
	int option = 0;
	
	while(pressedEnter != '\n')
	{
		printf("			--------------------------------\n");
		printf("			 WELCOME TO Tic-Tac-Toe !\n");
		printf("			--------------------------------\n");
		printf("			        -Press ENTER-\n");

		pressedEnter = getchar();
	}
	
	while(option != '4')
	{
		printf("			-------------------------\n");
		printf("			       Tic-Tac-Toe !\n");
		printf("			-------------------------\n");
		printf("			1.New Game\n");
		printf("			2.Continue Game\n");
		printf("			3.Achievements\n");
		printf("			4.Exit\n");
		printf("Option: ");
		option = getchar();

		printf("option has the value of: %d\n", option);

		while((option <= '0') && (option >= '5'))
		{
			printf("You need to choose between 1-5.\n");
			printf("Option: ");

			option = getchar();
		}
		
		switch(option)
		{
			case '1':
				linfo = CreateData();
				NewGame(linfo);
				break;
			
			case '2':
				//LoadGame();
				break;
			
			case '3':
				//ShowStatistics();
				break;
		}
	}
	return (0);
}
Exemplo n.º 23
0
void PlayDemo (int demonumber)
{
	int length;

#ifdef DEMOSEXTERN
// debug: load chunk
#ifndef SPEARDEMO
	int dems[4]={T_DEMO0,T_DEMO1,T_DEMO2,T_DEMO3};
#else
	int dems[1]={T_DEMO0};
#endif

	CA_CacheGrChunk(dems[demonumber]);
	demoptr = grsegs[dems[demonumber]];
	MM_SetLock (&grsegs[dems[demonumber]],true);
#else
	demoname[4] = '0'+demonumber;
	CA_LoadFile (demoname,&demobuffer);
	MM_SetLock (&demobuffer,true);
	demoptr = (char far *)demobuffer;
#endif

	NewGame (1,0);
	gamestate.mapon = *demoptr++;
	gamestate.difficulty = gd_hard;
	length = *((unsigned far *)demoptr)++;
	demoptr++;
	lastdemoptr = demoptr-4+length;

	VW_FadeOut ();

	SETFONTCOLOR(0,15);
	DrawPlayScreen ();
	VW_FadeIn ();

	startgame = false;
	demoplayback = true;

	SetupGameLevel ();
	StartMusic ();
	PM_CheckMainMem ();
	fizzlein = true;

	PlayLoop ();

#ifdef DEMOSEXTERN
	UNCACHEGRCHUNK(dems[demonumber]);
#else
	MM_FreePtr (&demobuffer);
#endif

	demoplayback = false;

	StopMusic ();
	VW_FadeOut ();
	ClearMemory ();
}
Exemplo n.º 24
0
void
PairsWindow::SetGameSize(uint8 rows, uint8 cols)
{
	RemoveChild(fPairsView);
	delete fPairsView;

	_MakeGameView(rows, cols);
	NewGame();
}
Exemplo n.º 25
0
static void
Restore (void)
{
    if (!PrefGetAppPreferencesV10 (RicochetFileCreator, RicochetVersionNum,
                                   &game, sizeof (Game)))
    {
        NewGame ();
    }
}
Exemplo n.º 26
0
void StartGame(void)
{	
	if (playstate!=EX_LOADGAME) {	/* Variables already preset */
		NewGame();				/* init basic game stuff */
	}
	SetupPlayScreen();
	GameLoop();			/* Play the game */
	StopSong();			/* Make SURE music is off */
}
Exemplo n.º 27
0
void ResetGame(void)
{
	NewGame ();

	ca_levelnum--;
	ca_levelbit>>=1;
	CA_ClearMarks();
	ca_levelbit<<=1;
	ca_levelnum++;
}
Exemplo n.º 28
0
void
ResetGame(void)
{
	NewGame ();

	ca_levelnum--;
	CA_ClearMarks();
	titleptr[ca_levelnum] = NULL;           // don't reload old level
	ca_levelnum++;
}
Exemplo n.º 29
0
void Game::ProcessEvents() {
    //Zmienna bool wspolna z klasa App
    if ( *m_is_done ) return;

    //W zaleznosci od stanu aplikacji, inne klasy przejmuja sterowanie
    if ( *m_game_state==GS::Play ) ControlGame();
    else if ( *m_game_state==GS::MainMenu
              || *m_game_state==GS::About  ) ControlMenu();
    else if ( *m_game_state==GS::SelectLevel ) NewGame();
}
Exemplo n.º 30
0
// The original starting point of the game EXE
void cat3d_exe_main (void)
{
	//id0_short_t i;

	if (refkeen_current_gamever == BE_GAMEVER_CAT3D122)
	{
		if (BE_Cross_strcasecmp(id0_argv[1], "/VER") == 0)
		{
			BE_ST_printf("Catacomb 3-D version 1.22  (Rev 1)\n");
			BE_ST_printf("Copyright 1991-93 Softdisk Publishing\n");
			BE_ST_printf("Developed for use with 100%% IBM compatibles\n");
			BE_ST_printf("that have 640K memory and DOS version 3.3 or later\n");
			BE_ST_printf("and EGA graphics or better.\n");
			BE_ST_HandleExit(0);
		}

		if (BE_Cross_strcasecmp(id0_argv[1], "/?") == 0)
		{
			BE_ST_printf("Catacomb 3-D version 1.22\n");
			BE_ST_printf("Copyright 1991-93 Softdisk Publishing\n\n");
			BE_ST_printf("Syntax:\n");
			BE_ST_printf("CAT3D [/<switch>]\n\n");
			BE_ST_printf("Switch       What it does\n");
			BE_ST_printf("/?           This Information\n");
			BE_ST_printf("/VER         Display Program Version Information\n");
			BE_ST_printf("/COMP        Fix problems with SVGA screens\n");
			BE_ST_printf("/NOAL        No AdLib or SoundBlaster detection\n");
			BE_ST_printf("/NOJOYS      Tell program to ignore joystick\n");
			BE_ST_printf("/NOMOUSE     Tell program to ignore mouse\n");
			BE_ST_printf("/HIDDENCARD  Overrides video detection\n\n");
			BE_ST_printf("Each switch must include a '/' and multiple switches\n");
			BE_ST_printf("must be seperated by at least one space.\n\n");

			BE_ST_HandleExit(0);
		}
	}
	// jabhack(); // REFKEEN - Commented out

	InitGame ();

	CheckMemory ();

	LoadLatchMem ();

#ifdef PROFILE
	NewGame ();
	GameLoop ();
#endif

//NewGame ();
//GameLoop ();

	DemoLoop();
	Quit("Demo loop exited???");
}