Lives >=5 are now shown by a "x5"

This commit is contained in:
Rob Pearce 2008-10-18 21:46:55 +00:00
parent 11dcca1cc4
commit 092cfa2180
5 changed files with 19 additions and 7 deletions

BIN
data/sprites/dwarfhead5.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

2
defs.h
View File

@ -754,7 +754,7 @@ imageset_t imageset[MAXPTYPES];
/* external globals */
extern SDL_Color black;
extern SDL_Surface *screen, *temps, *levelbg, *head, *icecube;
extern SDL_Surface *screen, *temps, *levelbg, *head, *head5, *icecube;
extern SDL_Surface *healthbar[];
extern SDL_Surface *greenbox;
extern sprite_t *sprite, *lastsprite, *player, *boss, *mask;

View File

@ -22,7 +22,7 @@ int nextforcegoodcard;
SDL_Surface *levelbg; // level background image
SDL_Surface *temps; // temporary surface
SDL_Surface *screen; // the actual video screen
SDL_Surface *head; // img in corner showing number of lives
SDL_Surface *head,*head5; // imgs in corner showing number of lives
SDL_Surface *icecube; // overlaid on frozen monsters
SDL_Surface *greenbox; // for fly spray effect
SDL_Surface *healthbar[HEALTHFRAMES]; // for boss health

18
rc.c
View File

@ -2962,7 +2962,7 @@ void drawlevel(void) {
int x,y;
int dstx,dsty,xdis,ydis;
double turns;
double pxspeed,pyspeed,pspeed;
double pspeed;
double dist;
SDL_Rect area,dst;
int speed = 16;
@ -3508,6 +3508,7 @@ void drawscore(void) {
SDL_Rect area;
SDL_Color scorecol;
int i;
int numtoshow;
if (forcegoodcard) {
if ((timer / LUCKYFLASH) % 2 == 0) {
@ -3540,12 +3541,21 @@ void drawscore(void) {
// lives
// lives - show 1 less than lives
// show 1 less than lives
numtoshow = player->lives-1;
area.x = 20;
area.y = 25;
area.w = 0;
area.h = 0;
for (i = 1; i < player->lives; i++) {
// show "x5" for lots of lives
while (numtoshow >= 5) {
SDL_BlitSurface(head5, NULL, screen, &area);
area.x += (head->w + 3);
numtoshow -= 5;
}
for (i = 0; i < numtoshow; i++) {
SDL_BlitSurface(head, NULL, screen, &area);
area.x += (head->w + 3);
}
@ -6613,7 +6623,7 @@ void handleinput(void) {
if (keydown(SDLK_l)) {
if (toggletimer == 0) {
addscore(player, 100001);
toggletimer = 80;
toggletimer = 30;
}
}
if (keydown(SDLK_n)) {

View File

@ -991,6 +991,8 @@ int loadimagesets(void) {
sprintf(tempfile, "%s/sprites/dwarfhead.png",datadir);
head = IMG_Load(tempfile);
sprintf(tempfile, "%s/sprites/dwarfhead5.png",datadir);
head5 = IMG_Load(tempfile);
sprintf(tempfile, "%s/sprites/icecube.png",datadir);
icecube = IMG_Load(tempfile);