You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
67 lines
1.4 KiB
67 lines
1.4 KiB
/* $Id: single.c,v 1.5 2003/05/05 15:53:27 stpohle Exp $ */
|
|
/* single player */
|
|
|
|
#include "basic.h"
|
|
#include "bomberclone.h"
|
|
|
|
void
|
|
single_game_new (int ai_players)
|
|
{
|
|
int p,
|
|
i;
|
|
|
|
// set players on field 1,1
|
|
for (p = 0; p < MAX_PLAYERS; p++) {
|
|
bman.players[p].pos.x = -1;
|
|
bman.players[p].pos.y = -1;
|
|
bman.players[p].state = 0;
|
|
|
|
// reset bombs
|
|
bman.players[p].bombs_n = START_BOMBS;
|
|
bman.players[p].range = START_RANGE;
|
|
bman.players[p].speed = START_SPEED;
|
|
for (i = 0; i < MAX_BOMBS; i++) {
|
|
bman.players[p].bombs[i].state = BS_off;
|
|
bman.players[p].bombs[i].ex_nr = -1;
|
|
}
|
|
|
|
for (i = 0; i < PI_max; i++)
|
|
bman.players[p].ill[i].to = 0;
|
|
bman.players[p].frame = 0;
|
|
bman.players[p].frameto = 0;
|
|
bman.players[p].d = 0;
|
|
}
|
|
|
|
bman.p_nr = 0;
|
|
bman.players[bman.p_nr].state = PSFM_alife;
|
|
player_set_gfx (&bman.players[bman.p_nr], 0);
|
|
bman.last_ex_nr = 1;
|
|
|
|
field_new (bman.fieldpath);
|
|
|
|
bman.players_nr_s = 1;
|
|
bman.players_nr = 1;
|
|
bman.gametype = GT_single;
|
|
bman.state = GS_running;
|
|
};
|
|
|
|
|
|
void single_loop () {
|
|
|
|
};
|
|
|
|
|
|
void single_create_ai () {
|
|
int p;
|
|
_player *pl;
|
|
|
|
/* find free players */
|
|
for (pl = NULL, p = 0; (pl == NULL && p < MAX_PLAYERS); p++)
|
|
if (!(PS_IS_used (bman.players[p].state)))
|
|
pl = &bman.players[p];
|
|
|
|
if (pl == NULL)
|
|
return;
|
|
|
|
};
|