Skip to content

Commit

Permalink
Multiplayer update
Browse files Browse the repository at this point in the history
git-svn-id: svn+ssh://c99.org/home/c99org/svn/DCSquares/trunk@117 8944af1b-4df6-0310-90e0-d6e02aab4a67
  • Loading branch information
c99koder committed Jan 22, 2006
1 parent e789adf commit a12d8a1
Show file tree
Hide file tree
Showing 15 changed files with 1,277 additions and 4,314 deletions.
4 changes: 4 additions & 0 deletions common/hud.cc
Expand Up @@ -247,6 +247,10 @@ void render_score(float gt) {
sprintf(tmp,"Survive for %i seconds",current_level->time);
center_shad(themeinfo.game_y+60,tmp,24,(gt<3)?limit(gt,0,1):(4.0f-gt),true);
}
if(current_level->win_mode == 0 && current_level->lose_mode == MODE_ENEMY) {
sprintf(tmp,"Avoid the red squares",current_level->time);
center_shad(themeinfo.game_y+60,tmp,24,(gt<3)?limit(gt,0,1):(4.0f-gt),true);
}
/*if(current_level->lose_mode & MODE_TIME) {
if(current_level->time < 60) {
sprintf(tmp,"in %i seconds",current_level->time);
Expand Down
61 changes: 42 additions & 19 deletions common/level.cc
Expand Up @@ -18,7 +18,7 @@ level_node *level_list_head=NULL;
level_node *level_list_tail=NULL;
level_node *free_play=NULL;
level_node *multi_play=NULL;
extern int score[MAX_PLAYERS],squares[MAX_PLAYERS];
extern int score[MAX_PLAYERS],squares[MAX_PLAYERS],dmloser;
int level_cnt=1;

level_node *create_level(int win_mode,int lose_mode) {
Expand Down Expand Up @@ -81,7 +81,7 @@ void levels_init() {
multi_play->win_mode=MODE_SQUARES;
multi_play->lose_mode=MODE_TIME;
multi_play->score=20000;
multi_play->time=60*5;
multi_play->time=60*3;
multi_play->squares=30;
multi_play->tickval=1.0f; //1.0
multi_play->min_tickval=0.6;
Expand Down Expand Up @@ -109,51 +109,74 @@ void levels_init() {
tmp->power_evil=0;

//Level 2:
//Collect 40 squares in 120 seconds
//Collect 30 squares in 120 seconds
//Score powerups
tmp=create_level(MODE_SQUARES,MODE_TIME|MODE_ENEMY);
tmp->squares=40;
tmp->squares=30;
tmp->time=120;
tmp->power_speed=0;
tmp->power_size=0;
tmp->power_score=1;
tmp->power_evil=0;

//Level 3:
//Collect 60 squares in 120 seconds
//Collect 40 squares in 120 seconds
//Score and size powerups
tmp=create_level(MODE_SQUARES,MODE_TIME|MODE_ENEMY);
tmp->squares=60;
tmp->squares=40;
tmp->time=120;
tmp->power_speed=0;
tmp->power_size=1;
tmp->power_score=1;
tmp->power_evil=0;
tmp->speedval=1.4f;

//Level 4:
//Earn 5000 points
//Collect 50 squares in 120 seconds
//Score, size, and speed powerups
tmp=create_level(MODE_SCORE,MODE_ENEMY);
tmp->score=5000;
//tmp->time=10;
tmp=create_level(MODE_SQUARES,MODE_TIME|MODE_ENEMY);
tmp->squares=50;
tmp->time=120;
tmp->power_speed=1;
tmp->power_size=1;
tmp->power_score=1;
tmp->power_evil=0;

tmp->power_evil=1;
tmp->speedval=1.6f;

//Level 5:
//Survive for 30 seconds
//All powerups
tmp=create_level(MODE_TIME,MODE_ENEMY);
tmp->time=30;
tmp->speedval=4;
tmp->tickval=0.6;
tmp->scoreval=1000;
//Collect 60 squares in 120 seconds
//Score, size, and speed powerups
tmp=create_level(MODE_SQUARES,MODE_TIME|MODE_ENEMY);
tmp->squares=60;
tmp->time=120;
tmp->power_speed=1;
tmp->power_size=1;
tmp->power_score=1;
tmp->power_evil=1;
tmp->speedval=1.8f;

//Level 6:
//Collect 70 squares in 120 seconds
//Score, size, and speed powerups
tmp=create_level(MODE_SQUARES,MODE_TIME|MODE_ENEMY);
tmp->squares=70;
tmp->time=120;
tmp->power_speed=1;
tmp->power_size=1;
tmp->power_score=1;
tmp->power_evil=1;
tmp->speedval=2.0f;

current_level = free_play;
}

int check_win(float gt, int p) {
if(current_level->players > 1 && dmloser != -1 && current_level->lose_mode & MODE_ENEMY && dmloser != p) {
return 1;
}
if(current_level->players > 1 && dmloser != -1 && current_level->lose_mode & MODE_ENEMY && dmloser == p) {
return -1;
}
if(current_level->lose_mode & MODE_TIME && (current_level->time - gt < 0)) {
//printf("time: lose\n");
return -1;
Expand Down
2 changes: 0 additions & 2 deletions common/score.cc
Expand Up @@ -80,8 +80,6 @@ void save_scores() {
}
}

tab->bitfield = SCORE_NAME | SCORE_SCORE | SCORE_TIME | SCORE_LEVEL;

if(goat_save_score_table(0,tab)<0) perror("save");
#else
FILE *f;
Expand Down
Binary file modified data/loading.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified goat/loading.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion tiki/dreamcast/Makefile
@@ -1,5 +1,5 @@
TIKI_BASE = /Users/sam/tiki
OBJS = ../src/TitleScreen.o ../src/DCSMenu.o ../src/GamePlay.o ../src/LevelStats.o ../src/HighScores.o ../src/NameEntry.o
OBJS = ../src/TitleScreen.o ../src/DCSMenu.o ../src/GamePlay.o ../src/LevelStats.o ../src/HighScores.o ../src/NameEntry.o ../src/MultiPlaySetup.o
OBJS += ../src/drawables/menuList.o ../src/drawables/playField.o ../src/drawables/squaresBg.o ../src/drawables/banna.o ../src/drawables/squaresHUD.o ../src/drawables/box.o
OBJS += ../src/main.o ../../common/TikiSquares.o ../../common/squares.o ../../common/text.o ../../common/texture.o ../../common/score.o ../../common/hud.o ../../common/theme.o ../../common/game.o ../../common/rand.o ../../common/level.o #vmuify.o icon.o lcd.o snake.o romdisk.o
OBJS += lcd.o romdisk.o
Expand Down
8 changes: 8 additions & 0 deletions tiki/osx/TikiSquares.xcodeproj/project.pbxproj
Expand Up @@ -43,6 +43,8 @@
2284517B095F2865002AF3FE /* squaresHUD.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 22845179095F2865002AF3FE /* squaresHUD.cpp */; };
228451F8095F6D91002AF3FE /* box.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = 228451F6095F6D91002AF3FE /* box.h */; };
228451F9095F6D91002AF3FE /* box.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 228451F7095F6D91002AF3FE /* box.cpp */; };
229ACE8B0979A234001928CA /* MultiPlaySetup.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = 229ACE890979A234001928CA /* MultiPlaySetup.h */; };
229ACE8C0979A234001928CA /* MultiPlaySetup.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 229ACE8A0979A234001928CA /* MultiPlaySetup.cpp */; };
22E2E7F40971ED0200D3CB40 /* NameEntry.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = 22E2E7F20971ED0200D3CB40 /* NameEntry.h */; };
22E2E7F50971ED0200D3CB40 /* NameEntry.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 22E2E7F30971ED0200D3CB40 /* NameEntry.cpp */; };
22F3A2C70953AA02005DB9D0 /* Controller.m in Sources */ = {isa = PBXBuildFile; fileRef = 22F3A2C40953AA02005DB9D0 /* Controller.m */; };
Expand Down Expand Up @@ -84,6 +86,7 @@
2208E34F096858F1005C2102 /* LevelStats.h in CopyFiles */,
2208E5D1096F47F7005C2102 /* HighScores.h in CopyFiles */,
22E2E7F40971ED0200D3CB40 /* NameEntry.h in CopyFiles */,
229ACE8B0979A234001928CA /* MultiPlaySetup.h in CopyFiles */,
);
runOnlyForDeploymentPostprocessing = 0;
};
Expand Down Expand Up @@ -145,6 +148,8 @@
22845179095F2865002AF3FE /* squaresHUD.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = squaresHUD.cpp; path = ../src/drawables/squaresHUD.cpp; sourceTree = SOURCE_ROOT; };
228451F6095F6D91002AF3FE /* box.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = box.h; path = ../src/drawables/box.h; sourceTree = SOURCE_ROOT; };
228451F7095F6D91002AF3FE /* box.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = box.cpp; path = ../src/drawables/box.cpp; sourceTree = SOURCE_ROOT; };
229ACE890979A234001928CA /* MultiPlaySetup.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = MultiPlaySetup.h; path = ../src/MultiPlaySetup.h; sourceTree = SOURCE_ROOT; };
229ACE8A0979A234001928CA /* MultiPlaySetup.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = MultiPlaySetup.cpp; path = ../src/MultiPlaySetup.cpp; sourceTree = SOURCE_ROOT; };
22E2E7F20971ED0200D3CB40 /* NameEntry.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = NameEntry.h; path = ../src/NameEntry.h; sourceTree = SOURCE_ROOT; };
22E2E7F30971ED0200D3CB40 /* NameEntry.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = NameEntry.cpp; path = ../src/NameEntry.cpp; sourceTree = SOURCE_ROOT; };
22F3A2C30953AA02005DB9D0 /* Controller.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = Controller.h; sourceTree = "<group>"; };
Expand Down Expand Up @@ -263,6 +268,8 @@
2208E5D0096F47F7005C2102 /* HighScores.cpp */,
22E2E7F20971ED0200D3CB40 /* NameEntry.h */,
22E2E7F30971ED0200D3CB40 /* NameEntry.cpp */,
229ACE890979A234001928CA /* MultiPlaySetup.h */,
229ACE8A0979A234001928CA /* MultiPlaySetup.cpp */,
);
name = Menus;
sourceTree = "<group>";
Expand Down Expand Up @@ -423,6 +430,7 @@
2208E350096858F1005C2102 /* LevelStats.cpp in Sources */,
2208E5D2096F47F7005C2102 /* HighScores.cpp in Sources */,
22E2E7F50971ED0200D3CB40 /* NameEntry.cpp in Sources */,
229ACE8C0979A234001928CA /* MultiPlaySetup.cpp in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
Expand Down

0 comments on commit a12d8a1

Please sign in to comment.