respawn test 2

origin
stpohle 22 years ago
parent a2cb79c9d8
commit f7d1b74fd4

@ -1,4 +1,4 @@
/* $Id: bomberclone.h,v 1.19 2004/01/27 21:13:40 stpohle Exp $ */ /* $Id: bomberclone.h,v 1.20 2004/01/27 22:17:22 stpohle Exp $ */
/* bomberclone.h */ /* bomberclone.h */
#ifndef _BOMBERCLONE_H_ #ifndef _BOMBERCLONE_H_
@ -196,7 +196,7 @@ extern void stonelist_del ();
extern void stonelist_draw (); extern void stonelist_draw ();
// everything what is declared in players.c // everything what is declared in players.c
extern int dead_playerani (); extern void dead_playerani ();
extern void draw_player (_player * player); extern void draw_player (_player * player);
extern void restore_players_screen (); extern void restore_players_screen ();
extern void move_player (int pl_nr); extern void move_player (int pl_nr);

@ -86,7 +86,7 @@ void debug_ingameinfo() {
font_gfxdraw (0, gfx.res.y-font[0].size.y*2, text, 0, 0, (map.size.y*256)+10); font_gfxdraw (0, gfx.res.y-font[0].size.y*2, text, 0, 0, (map.size.y*256)+10);
if (bman.p_nr >= 0 && bman.p_nr < MAX_PLAYERS) { if (bman.p_nr >= 0 && bman.p_nr < MAX_PLAYERS) {
sprintf (text, "Pos: %2.3f,%2.3f", players[bman.p_nr].pos.x, players[bman.p_nr].pos.y); sprintf (text, "Pos: %2.3f,%2.3f Status:%d Frame:%2.2f", players[bman.p_nr].pos.x, players[bman.p_nr].pos.y, players[bman.p_nr].state, players[bman.p_nr].frame);
font_gfxdraw (350, gfx.res.y-font[0].size.y, text, 0, 0, (map.size.y*256)+10); font_gfxdraw (350, gfx.res.y-font[0].size.y, text, 0, 0, (map.size.y*256)+10);
} }
}; };

@ -1,4 +1,4 @@
/* $Id: mapmenu.c,v 1.20 2004/01/25 19:36:50 stpohle Exp $ */ /* $Id: mapmenu.c,v 1.21 2004/01/27 22:17:22 stpohle Exp $ */
/* map/tileset selection menu */ /* map/tileset selection menu */
#include "bomberclone.h" #include "bomberclone.h"
@ -351,7 +351,9 @@ void mapgamesetting () {
menuselect = menu_loop (); menuselect = menu_loop ();
menu_delete (); menu_delete ();
if (menuselect == 0) if (menuselect == 0) {
bman.gametype = gametype_sel- &gametype[0];
menuselect = -1; menuselect = -1;
} }
}
}; };

@ -1,4 +1,4 @@
/* $Id: player.c,v 1.70 2004/01/27 21:58:06 stpohle Exp $ /* $Id: player.c,v 1.71 2004/01/27 22:17:22 stpohle Exp $
* player.c - everything what have to do with the player */ * player.c - everything what have to do with the player */
#include <SDL.h> #include <SDL.h>
@ -59,6 +59,8 @@ draw_player (_player * player)
else if (PS_IS_respawn (player->state)) { else if (PS_IS_respawn (player->state)) {
/* player is respawning /* player is respawning
* first: draw the star */ * first: draw the star */
printf ("Respawn Drawing \n");
dest.w = src.w = gfx.respawn.image->w; dest.w = src.w = gfx.respawn.image->w;
dest.h = src.h = player->gfx->ani.h; dest.h = src.h = player->gfx->ani.h;
@ -585,26 +587,22 @@ player_animation (_player * player)
player->frame += player->gfx->ani.frames; player->frame += player->gfx->ani.frames;
} }
if (PS_IS_dead (player->state)) { if (PS_IS_dead (player->state) || PS_IS_respawn (player->state)) {
if ((int)player->frame < gfx.dead.frames) if ((int)player->frame < gfx.dead.frames)
player->frame += (timefactor * ANI_PLAYERTIMEOUT); player->frame += (timefactor * ANI_PLAYERTIMEOUT);
} }
}; };
int void
dead_playerani () dead_playerani ()
{ {
int i, int i;
b = 0;
for (i = 0; i < MAX_PLAYERS; i++) for (i = 0; i < MAX_PLAYERS; i++)
if (PS_IS_dead (players[i].state)) { if (PS_IS_dead (players[i].state) || PS_IS_respawn (players[i].state)) {
player_animation (&players[i]); player_animation (&players[i]);
b++;
} }
return b;
}; };
@ -867,6 +865,7 @@ void player_checkdeath (int pnr) {
/* check for respawn */ /* check for respawn */
if (bman.gametype == GT_deathmatch && PS_IS_dead (player->state) && player->frame >= gfx.dead.frames) { if (bman.gametype == GT_deathmatch && PS_IS_dead (player->state) && player->frame >= gfx.dead.frames) {
/* check new position */ /* check new position */
printf ("Respawn Test OK\n");
trypos = 0; trypos = 0;
do { do {
map_set_player_way1 (pnr); map_set_player_way1 (pnr);

Loading…
Cancel
Save