From 092cfa218006c64e0e2c1f34fc6e675611fe4148 Mon Sep 17 00:00:00 2001 From: Rob Pearce Date: Sat, 18 Oct 2008 21:46:55 +0000 Subject: [PATCH] Lives >=5 are now shown by a "x5" --- data/sprites/dwarfhead5.png | Bin 0 -> 1129 bytes defs.h | 2 +- globals.h | 2 +- rc.c | 20 +++++++++++++++----- shared.c | 2 ++ 5 files changed, 19 insertions(+), 7 deletions(-) create mode 100644 data/sprites/dwarfhead5.png diff --git a/data/sprites/dwarfhead5.png b/data/sprites/dwarfhead5.png new file mode 100644 index 0000000000000000000000000000000000000000..b4b3ee432b641c504dac0e4eea7c735f90013a79 GIT binary patch literal 1129 zcmV-v1eW`WP)1v~cH$x{FT03CEi zSad^gZEa<4bO1wgWnpw>WFU8GbZ8({Xk{QrNlj4iWF>9@00YfQL_t(I%Z-&?Y*S?z z$A9lRJ#9xj`@yiI8;lMnEK!!27_$myE{!3&xOugO3o{cFZcKEEF%B<{#uzW~(hK8I zG~I==Zfp=}!00S7Q_K==H#S;U`LMt~8V0m$PhT%iTf16_&&@gKd7uCPdC&iOp7#YH z8l81|LqQph&i?KV1tpKL%D8BB)~Q6Jv+lq`Y_+(a=Kon5Ag~Zy6}2+n=p7J`+Ck|( z+}1u~3b(ZbtOXWg&JwWar9-YuM+R4_!B2la;yzW3DH8RWYGo;bcYOHiFD2h!@4xfx zr6YqYOr6=ZJMl2lUKl-jCzsP3q?8CD&@}bVh5lC?Dr3TJ?IWTn;xfPw?N6?}_wG^d z-o2+Cdih10)ofKt1euLY;mqXOd-e6U+{d4ML|5z&H-G>*KJtZg*kxONYyJv}#1dxB zgs;_yA`}X;P<|%j2{v+he7+Vw+q;{g`GiXWIPvuf0LI5AX!17FvA+YW*@~*DXo`la zs94QbI`((amO zWgQfN9Sx5I;IwVQtXdGLXeJAKc7x^Qb@c28n#u5+RSQnr767)p+=d31zyHqJrRG+@ zyt&3ReZ4q59&{<0k6a`Y{1*SfVfOkvQH3C#N-;AQ;`QxLKKSiVLxWun+W@eeEzHHD zEG4g@35AyCX6h9aEzQknLSZR+jk#D9yV+uNrOR#n!bUz1z|~}u&aQ6ydwT%LWV76V z@PJG<3qXHw51n1zTuml7Yfv()#k{GR6jcQwjORn*HWB0t1pr1vr;IjLRm^pDh$2DB zUy1{aGTOVl*Sw)1kJ;@U8ydpyaB$$jLDpASaJb#XXJ)vyc!lZdpIA?)+2`~9I}5eO z^mzOxLQ2*%S^iF^X>>T~J33rzWJKj;$qF)V^bW9V-xG$obC;QDILKDj!m^%at7?e@ zP5xBaQU*snfo~$7KqBG^EET^cAcH4IB_My^-Bb2eCM$_3{HgF^zys`zcmiaf+Gzyj zj1r6W3;+>NU_Igq+%J(-A6+uy2>{?vg&F^91ewbrG>unY8!Qo&i{?*-O-dCwU&)qr z*%6Dk%HS$fDt90&m<@+X;koN)tFxBPp9%vAr3(COaRHGxn&tc(!}wESq#`KPnenH> zWiVAGlz=Sug9PNc@RU4#dR(3hPgSq~w~=a{{ckTW-A329p{g9)(^B)!FaiA7+Uk5h v9$%}xSiGU2yf8C!9=Hv_o|ZRjT{!;$LT8(zD1jpJ00000NkvXXu0mjfDFgm} literal 0 HcmV?d00001 diff --git a/defs.h b/defs.h index af1c7f4..e63ff88 100644 --- a/defs.h +++ b/defs.h @@ -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; diff --git a/globals.h b/globals.h index a8e110f..140db6d 100644 --- a/globals.h +++ b/globals.h @@ -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 diff --git a/rc.c b/rc.c index 0cfccac..d872595 100644 --- a/rc.c +++ b/rc.c @@ -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) { @@ -3539,13 +3540,22 @@ void drawscore(void) { SDL_FreeSurface(score); // 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)) { diff --git a/shared.c b/shared.c index 6367058..b89e679 100644 --- a/shared.c +++ b/shared.c @@ -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);