Permalink
Browse files

Changed the way multiplayer levels are loaded as suggested by Asmaged…

…don.

Renamed 'pitfight' and 'pitfall' (used in earlier commit, my mistake) to 'duel'.
Changed multiplayerlevel filenames:
[numberofplayers][gametype][number].lvl
like:
2duel3.lvl
  • Loading branch information...
FrozenCow committed Jun 9, 2010
1 parent 818a3f6 commit 212e94c8b27451fdd1d8a84f1dfb475387309bfb
Showing with 46 additions and 94 deletions.
  1. +1 −1 game/english.h
  2. +1 −1 game/level.h
  3. +3 −3 game/logic.c
  4. +3 −3 game/mainmenu.c
  5. +1 −1 game/setup.c
  6. +37 −85 game/vsmode.c
  7. BIN texture/{pitfight.tga → duel.tga}
View
@@ -222,7 +222,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#define TXT_SUMO "Sumo"
#define TXT_FOOTBALL "Football"
#define TXT_GREED "Greed"
#define TXT_PITFIGHT "Pitfight"
#define TXT_DUEL "Duel"
#define TXT_DRAGSTER "Dragster"
#define TXT_COLLECTION "Collection"
#define TXT_RACING "Racing"
View
@@ -41,7 +41,7 @@ typedef enum {
GAMETYPE_2FOOTBALL = 10,
GAMETYPE_2SUMO = 11,
GAMETYPE_2GREED = 12,
GAMETYPE_2PITFALL = 13,
GAMETYPE_2DUEL = 13,
GAMETYPE_2DRAGSTER = 14,
GAMETYPE_2COLLECTION = 15,
GAMETYPE_2RACING = 16,
View
@@ -99,7 +99,7 @@ void gamelogic(void)
view.position[1]=130.0f;
view.position[2]=10.0f;
}
if (level.gametype==GAMETYPE_2PITFALL)
if (level.gametype==GAMETYPE_2DUEL)
{
view.position[0]=127.0f;
view.position[1]=124.5f;
@@ -373,7 +373,7 @@ void gamelogic(void)
}
}
}
if (level.gametype==GAMETYPE_2PITFALL)
if (level.gametype==GAMETYPE_2DUEL)
{
if (game.scoredelay==0)
{
@@ -1248,7 +1248,7 @@ void gamedisplay(void)
drawbackground(821,640-512,480-256,512,256,640,480);
}
}
if (level.gametype==GAMETYPE_2PITFALL)
if (level.gametype==GAMETYPE_2DUEL)
{
red=1.0f;
green=(float)(object[0].hitpoints)/500.0f;
View
@@ -128,7 +128,7 @@ void mainmenu(void)
loadtexturetga(531,"football.tga",0,GL_CLAMP_TO_EDGE,GL_CLAMP_TO_EDGE,GL_LINEAR,GL_LINEAR);
loadtexturetga(532,"greed.tga",0,GL_CLAMP_TO_EDGE,GL_CLAMP_TO_EDGE,GL_LINEAR,GL_LINEAR);
loadtexturetga(533,"pitfight.tga",0,GL_CLAMP_TO_EDGE,GL_CLAMP_TO_EDGE,GL_LINEAR,GL_LINEAR);
loadtexturetga(533,"duel.tga",0,GL_CLAMP_TO_EDGE,GL_CLAMP_TO_EDGE,GL_LINEAR,GL_LINEAR);
loadtexturetga(534,"dragster.tga",0,GL_CLAMP_TO_EDGE,GL_CLAMP_TO_EDGE,GL_LINEAR,GL_LINEAR);
loadtexturetga(535,"collect.tga",0,GL_CLAMP_TO_EDGE,GL_CLAMP_TO_EDGE,GL_LINEAR,GL_LINEAR);
@@ -431,8 +431,8 @@ void versusmenu(void)
setmenuitem(MO_HOTKEY,SCAN_F);
createmenuitem(TXT_GREED,(512|TEXT_CENTER),304,16,1.0f,1.0f,1.0f,1.0f);
setmenuitem(MO_HOTKEY,SCAN_G);
createmenuitem(TXT_PITFIGHT,(152|TEXT_CENTER),444,16,1.0f,1.0f,1.0f,1.0f);
setmenuitem(MO_HOTKEY,SCAN_P);
createmenuitem(TXT_DUEL,(152|TEXT_CENTER),444,16,1.0f,1.0f,1.0f,1.0f);
setmenuitem(MO_HOTKEY,SCAN_U);
createmenuitem(TXT_DRAGSTER,(320|TEXT_CENTER),444,16,1.0f,1.0f,1.0f,1.0f);
setmenuitem(MO_HOTKEY,SCAN_D);
if (unlocked)
View
@@ -389,7 +389,7 @@ void setupgame(void)
view.position[1]=130.0f;
view.position[2]=10.0f;
}
if (level.gametype==GAMETYPE_2PITFALL)
if (level.gametype==GAMETYPE_2DUEL)
{
view.position[0]=127.0f;
view.position[1]=124.5f;
View
@@ -46,6 +46,9 @@ void versusmodemenu(int versusnum)
int count;
int unlocked;
char filename[32];
BOOLEAN is4Player;
char* gametypeName;
BOOLEAN menuItemClicked = FALSE;
unlocked=0;
for (count=0;count<6;count++)
@@ -122,91 +125,40 @@ void versusmodemenu(int versusnum)
SDL_GL_SwapBuffers();
if (versusnum==0)
strcpy(filename,"bathhouse");
if (versusnum==1)
strcpy(filename,"field");
if (versusnum==2)
strcpy(filename,"amber");
if (versusnum==3)
strcpy(filename,"fight");
if (versusnum==4)
strcpy(filename,"dragster");
if (versusnum==5)
strcpy(filename,"colvs");
if (versusnum==6)
strcpy(filename,"racing");
if (menuitem[1].active)
{
game.songnum=-1;
checkmusic();
game.levelnum=0;
strcat(filename,".lvl");
loadlevel(filename);
gameloop();
}
if (menuitem[2].active)
{
game.songnum=-1;
checkmusic();
game.levelnum=0;
strcat(filename,"2.lvl");
loadlevel(filename);
gameloop();
}
if (menuitem[3].active)
{
game.songnum=-1;
checkmusic();
game.levelnum=0;
strcat(filename,"3.lvl");
loadlevel(filename);
gameloop();
}
if (menuitem[4].active)
{
game.songnum=-1;
checkmusic();
game.levelnum=0;
strcat(filename,"4.lvl");
loadlevel(filename);
gameloop();
}
if (menuitem[5].active)
{
game.songnum=-1;
checkmusic();
if (versusnum==0)
strcpy(filename,"4bath");
if (versusnum==1)
strcpy(filename,"4field");
game.levelnum=0;
strcat(filename,".lvl");
loadlevel(filename);
gameloop();
}
if (menuitem[6].active)
{
game.songnum=-1;
checkmusic();
if (versusnum==0)
strcpy(filename,"4bath");
if (versusnum==1)
strcpy(filename,"4field");
game.levelnum=0;
strcat(filename,"2.lvl");
loadlevel(filename);
gameloop();
}
// Is item clicked?
if (!(menuitem[1].active || menuitem[2].active || menuitem[3].active || menuitem[4].active || menuitem[5].active || menuitem[6].active))
continue;
is4Player = menuitem[5].active || menuitem[6].active;
gametypeName = NULL;
switch (versusnum)
{
case 0: gametypeName = is4Player ? "4sumo" : "2sumo"; break;
case 1: gametypeName = is4Player ? "4football" : "2football"; break;
case 2: gametypeName = "2greed"; break;
case 3: gametypeName = "2duel"; break;
case 4: gametypeName = "2dragster"; break;
case 5: gametypeName = "2collection"; break;
case 6: gametypeName = "2racing"; break;
}
strcpy(filename, gametypeName);
// 2 player.
if (menuitem[1].active) strcat(filename, "1");
else if (menuitem[2].active) strcat(filename, "2");
else if (menuitem[3].active) strcat(filename, "3");
else if (menuitem[4].active) strcat(filename, "4");
// 4 player.
else if (menuitem[5].active) strcat(filename, "1");
else if (menuitem[6].active) strcat(filename, "2");
strcat(filename, ".lvl");
game.songnum=-1;
checkmusic();
game.levelnum=0;
loadlevel(filename);
gameloop();
}
resetmenuitems();
File renamed without changes.

0 comments on commit 212e94c

Please sign in to comment.