- Reduce time between mode transitions in title screen.

- Add a credits screen during title sequence
This commit is contained in:
Rob Pearce 2016-07-25 19:49:48 +12:00
parent 0ed87c7927
commit cc14a2194e
4 changed files with 78 additions and 24 deletions

4
defs.h
View File

@ -90,6 +90,7 @@
#define TEXTSIZE_GAMEOVER 50 #define TEXTSIZE_GAMEOVER 50
#define TEXTSIZE_HISCORE 16 #define TEXTSIZE_HISCORE 16
#define TEXTSIZE_ENDING 16 #define TEXTSIZE_ENDING 16
#define TEXTSIZE_CREDITS 16
// text tuypes // text tuypes
@ -812,8 +813,9 @@ enum SPELL {
#define TS_WAIT1UP 1 #define TS_WAIT1UP 1
#define TS_SELECTMODE 2 #define TS_SELECTMODE 2
#define TS_HISCORES 3 #define TS_HISCORES 3
#define TS_CREDITS 4
#define TTIME 10 // time between state switches in title screen #define TTIME 5 // time between state switches in title screen
#define INITPLAYERLIVES 3 #define INITPLAYERLIVES 3

77
rc.c
View File

@ -128,7 +128,7 @@ int initialswapplayers = B_FALSE;
int fps; int fps;
int fpscount; int fpscount;
int titlemode; int titlemode = TS_INSERTCOIN;
int blinkspeed; int blinkspeed;
int credits = 0; int credits = 0;
int titledone; int titledone;
@ -12910,7 +12910,8 @@ void dotitlescreen(void) {
helpoff = TTF_RenderText_Solid(font[TEXTSIZE_TITLE], "Off", green2); helpoff = TTF_RenderText_Solid(font[TEXTSIZE_TITLE], "Off", green2);
helpon = TTF_RenderText_Solid(font[TEXTSIZE_TITLE], "On", green2); helpon = TTF_RenderText_Solid(font[TEXTSIZE_TITLE], "On", green2);
sprintf(svnver, "%s", REV); //sprintf(svnver, "rpearce, 2006-2016 - %s", REV);
sprintf(svnver, "By rpearce, 2006-2016");
ver = TTF_RenderText_Solid(font[TEXTSIZE_VER], svnver, greenish); ver = TTF_RenderText_Solid(font[TEXTSIZE_VER], svnver, greenish);
@ -12932,7 +12933,6 @@ void dotitlescreen(void) {
switch (event.type) { switch (event.type) {
case SDL_JOYAXISMOTION: case SDL_JOYAXISMOTION:
j = event.jaxis.which; j = event.jaxis.which;
joyx[j] = SDL_JoystickGetAxis(joy[j],0); joyx[j] = SDL_JoystickGetAxis(joy[j],0);
joyy[j] = SDL_JoystickGetAxis(joy[j],1); joyy[j] = SDL_JoystickGetAxis(joy[j],1);
//printf("got joy motion: joy %d, x=%d,y=%d\n",j,joyx[j],joyy[j]); //printf("got joy motion: joy %d, x=%d,y=%d\n",j,joyx[j],joyy[j]);
@ -12967,16 +12967,16 @@ void dotitlescreen(void) {
} }
} }
// draw screen // draw screen
if (titlemode != TS_HISCORES) { if ((titlemode == TS_HISCORES) || (titlemode == TS_CREDITS)) {
SDL_BlitSurface(titlebg, NULL, screen, NULL); // clear screen to black
} else {
SDL_FillRect(screen, NULL, SDL_MapRGB(screen->format, 0, 0, 0)); SDL_FillRect(screen, NULL, SDL_MapRGB(screen->format, 0, 0, 0));
} else {
// draw titlescreen background
SDL_BlitSurface(titlebg, NULL, screen, NULL);
} }
if (titlemode != TS_HISCORES) { if (titlemode == TS_INSERTCOIN) {
// version number // version number
//area.x = SCREENW - (ver->w) - 10; //area.x = SCREENW - (ver->w) - 10;
area.x = (SCREENW/2) - (ver->w/2) - 10; area.x = (SCREENW/2) - (ver->w/2) - 10;
@ -12990,8 +12990,8 @@ void dotitlescreen(void) {
SDL_BlitSurface(ver, NULL, screen, &area); SDL_BlitSurface(ver, NULL, screen, &area);
} }
// mode-specific text // "insert coin" text
if ((titlemode == TS_INSERTCOIN) || (titlemode == TS_HISCORES)) { if ((titlemode == TS_INSERTCOIN) || (titlemode == TS_HISCORES) || (titlemode == TS_CREDITS)) {
if (texton) { if (texton) {
area.x = 320 - (cointext->w/2)+2; area.x = 320 - (cointext->w/2)+2;
area.y = 10; area.y = 10;
@ -13143,9 +13143,10 @@ void dotitlescreen(void) {
SDL_BlitSurface(desc, NULL, screen, &area); SDL_BlitSurface(desc, NULL, screen, &area);
SDL_FreeSurface(desc); SDL_FreeSurface(desc);
} }
} else if (titlemode == TS_HISCORES) { } else if (titlemode == TS_HISCORES) {
drawhiscores(); drawhiscores();
} else if (titlemode == TS_CREDITS) {
drawgamecredits();
} }
bouncetimer += 7; bouncetimer += 7;
@ -13171,13 +13172,15 @@ void dotitlescreen(void) {
if ((htime > 0) && (htime % TTIME == 0)) { if ((htime > 0) && (htime % TTIME == 0)) {
if (titlemode == TS_INSERTCOIN) { if (titlemode == TS_INSERTCOIN) {
// INSERTCOIN -> NORMAL HISCORES // INSERTCOIN -> NORMAL HISCORES
if (wanthiscores) gethiscores(easymode());
titlemode = TS_HISCORES; titlemode = TS_HISCORES;
if (wanthiscores) gethiscores(easymode());
} else if (titlemode == TS_HISCORES) { } else if (titlemode == TS_HISCORES) {
// next time, get other hiscores // next time, get other hiscores
if (gamemode == GM_EASY) gamemode = GM_NORM; if (gamemode == GM_EASY) gamemode = GM_NORM;
else gamemode = GM_EASY; else gamemode = GM_EASY;
// NORMAL HISCORES -> INSERTCOIN // NORMAL HISCORES -> INSERTCOIN
titlemode = TS_CREDITS;
} else if (titlemode == TS_CREDITS) {
titlemode = TS_INSERTCOIN; titlemode = TS_INSERTCOIN;
} }
} }
@ -13536,6 +13539,54 @@ int submithiscore(int score,int level, char *name) {
return submithiscore_local(score, level, name); return submithiscore_local(score, level, name);
} }
void drawgamecredits(void) {
int x,y,sx,sy;
int indent = 200;
// draw credits for game
sx = 110;
sy = 50;
x = sx;
y = sy;
// headings
drawoutlinecentretext(screen, y, TEXTSIZE_CREDITS, "Credits", &cyan, &blue);
y += (TEXTSIZE_CREDITS*2);
drawoutlinetext(screen, x, y, TEXTSIZE_CREDITS, "Code:", &white, &grey2);
x += indent;
drawoutlinetext(screen, x, y, TEXTSIZE_CREDITS, "Rob Pearce", &red, &red2);
x = sx;
y += TEXTSIZE_CREDITS;
y += (TEXTSIZE_CREDITS/2);
drawoutlinetext(screen, x, y, TEXTSIZE_CREDITS, "Graphics:", &white, &grey2);
x += indent;
drawoutlinetext(screen, x, y, TEXTSIZE_CREDITS, "Rob Pearce", &red, &red2);
x = sx;
y += TEXTSIZE_CREDITS;
y += (TEXTSIZE_CREDITS/2);
drawoutlinetext(screen, x, y, TEXTSIZE_CREDITS, "Music:", &white, &grey2);
x += indent;
drawoutlinetext(screen, x, y, TEXTSIZE_CREDITS, "Deelite", &red, &red2);
y += TEXTSIZE_CREDITS;
drawoutlinetext(screen, x, y, TEXTSIZE_CREDITS, "Teo / Fatal Rage", &red, &red2);
y += TEXTSIZE_CREDITS;
drawoutlinetext(screen, x, y, TEXTSIZE_CREDITS, "Jess", &red, &red2);
y += TEXTSIZE_CREDITS;
y += (TEXTSIZE_CREDITS/2);
x = sx;
drawoutlinetext(screen, x, y, TEXTSIZE_CREDITS, "Giant Cookie:", &white, &grey2);
x += indent;
drawoutlinetext(screen, x, y, TEXTSIZE_CREDITS, "Karen", &red, &red2);
x = sx;
y += TEXTSIZE_CREDITS;
y += (TEXTSIZE_CREDITS/2);
}
int submithiscore_inet(int score,int level, char *name) { int submithiscore_inet(int score,int level, char *name) {
struct sockaddr_in serveraddress; struct sockaddr_in serveraddress;
struct hostent *server; struct hostent *server;

1
rc.h
View File

@ -109,6 +109,7 @@ void setjoymappings(void);
int joybuttondown(int whichplayer, int key); int joybuttondown(int whichplayer, int key);
int joybuttontokey(int buttonnum); int joybuttontokey(int buttonnum);
void drawcredits(void); void drawcredits(void);
void drawgamecredits(void);
int drawoutlinetext(SDL_Surface *where,int x, int y, int size, char *msg, SDL_Color *col, SDL_Color *bgcol); int drawoutlinetext(SDL_Surface *where,int x, int y, int size, char *msg, SDL_Color *col, SDL_Color *bgcol);
void drawoutlinetextcentre(SDL_Surface *where,int y, int size, char *msg, SDL_Color *col, SDL_Color *bgcol); void drawoutlinetextcentre(SDL_Surface *where,int y, int size, char *msg, SDL_Color *col, SDL_Color *bgcol);
int socket_readline(int sock, char *out); int socket_readline(int sock, char *out);

20
todo
View File

@ -1,7 +1,14 @@
*level 80 - should beb able to drop through icebridgethick floors - Half time between switching views in title screen
*give 10 more seconds on "snailsandslugs"
animate players hanging from umbrellas - Credits
- giant cookie = karen
- code = rob
- graphics = rob
- music = ???
- animate players hanging from umbrellas ?
- sometimes when falling on to a trampoline at an angle, I teleport up to the top of the screen. - sometimes when falling on to a trampoline at an angle, I teleport up to the top of the screen.
@ -27,8 +34,6 @@ animate players hanging from umbrellas
- top left tile is always blank?? - top left tile is always blank??
make base walk speed _slightly_ faster?
- New powerups: - New powerups:
- until end of level - until end of level
- [ ] treasure map- chest falls at end of level and shoots - [ ] treasure map- chest falls at end of level and shoots
@ -104,11 +109,6 @@ make base walk speed _slightly_ faster?
- boss - boss
- hiscore - hiscore
- Credits
- giant cookie = karen
- code = rob
- graphics = rob
- music = ???
- New features - New features
- pipes - pipes