setting single mode back for release of 0.9.8

origin
stpohle 23 years ago
parent d964440d5f
commit 9caabcb9ba

@ -50,7 +50,6 @@ game_draw_info ()
SDL_BlitSurface (bman.players[i].gfx->smal_image, &src, gfx.screen, &dest); SDL_BlitSurface (bman.players[i].gfx->smal_image, &src, gfx.screen, &dest);
} }
sprintf (scrtext, "%10s:%2d", bman.players[i].name, bman.players[i].points); sprintf (scrtext, "%10s:%2d", bman.players[i].name, bman.players[i].points);
if ((bman.players[i].state & PSFM_alife) != PSFM_alife) { // Player is dead if ((bman.players[i].state & PSFM_alife) != PSFM_alife) { // Player is dead
draw_text (x, j, scrtext, 0); draw_text (x, j, scrtext, 0);
@ -213,7 +212,7 @@ game_loop ()
/* check if there is only one player left and the game is in multiplayer mode /* check if there is only one player left and the game is in multiplayer mode
and if there the last dieing animation is done */ and if there the last dieing animation is done */
if (bman.players_nr < 2) if ((GT_MP_PTP && bman.players_nr < 2) || (bman.players_nr == 0))
gameovertimeout--; gameovertimeout--;
if (gameovertimeout <= 0) { if (gameovertimeout <= 0) {

@ -1,4 +1,4 @@
/* $Id: single.c,v 1.11 2003/05/11 17:27:30 stpohle Exp $ */ /* $Id: single.c,v 1.12 2003/05/11 23:32:42 stpohle Exp $ */
/* single player */ /* single player */
#include "basic.h" #include "basic.h"
@ -60,16 +60,49 @@ single_game_new ()
bman.state = GS_running; bman.state = GS_running;
}; };
/* check if is there is a bom in the near
returns the directions (bits 0(left)-3(down)) where a bomb is */
int ai_findnearbombs (_player *pl) {
int d,
res = 0, // result if there is a bomb
dist[4][3]; // to check every direction (on three ways)
_point m[4]; // direction addition
for (d = 0; d < 4; d++) {
switch (d) {
case (left):
m[d].x = -1;
m[d].y = 0;
break;
case (right):
m[d].x = 1;
m[d].y = 0;
break;
case (up):
m[d].x = 0;
m[d].y = -1;
break;
case (down):
m[d].x = 0;
m[d].y = 1;
break;
}
};
return res;
}
void void
single_loop () single_loop ()
{ {
int p; int p;
_player *pl; _player *pl;
for (p = 0; p < MAX_PLAYERS; p++) for (p = 0; p < MAX_PLAYERS; p++)
if (p != bman.p_nr && PS_IS_playing (bman.players[p].state)) { if (p != bman.p_nr && PS_IS_playing (bman.players[p].state)) {
pl = &bman.players[p]; pl = &bman.players[p];
player_ilness_loop (p); player_ilness_loop (p);
} }
}; };
@ -105,7 +138,7 @@ void single_playergame () {
for (p = 0; p < MAX_PLAYERS; p++) for (p = 0; p < MAX_PLAYERS; p++)
bman.players[p].state = 0; bman.players[p].state = 0;
single_create_ai (4); // single_create_ai (4);
single_game_new (); single_game_new ();
gfx_game_init (); gfx_game_init ();
game_loop (); game_loop ();

Loading…
Cancel
Save