summaryrefslogtreecommitdiff
path: root/noncore/games/sfcave-sdl/sfcave_game.cpp
Side-by-side diff
Diffstat (limited to 'noncore/games/sfcave-sdl/sfcave_game.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/games/sfcave-sdl/sfcave_game.cpp14
1 files changed, 13 insertions, 1 deletions
diff --git a/noncore/games/sfcave-sdl/sfcave_game.cpp b/noncore/games/sfcave-sdl/sfcave_game.cpp
index 72c5ce3..1b00e14 100644
--- a/noncore/games/sfcave-sdl/sfcave_game.cpp
+++ b/noncore/games/sfcave-sdl/sfcave_game.cpp
@@ -36,12 +36,25 @@ void SFCaveGame :: init()
case MENU_DIFFICULTY_NORMAL:
blockDistance = 40;
break;
case MENU_DIFFICULTY_HARD:
blockDistance = 30;
break;
+ case MENU_DIFFICULTY_CUSTOM:
+ {
+ // Read custom difficulty settings for this game
+ blockDistance = parent->loadIntSetting( "SFCave_custom_blockdistance", 50 );
+
+ double thrust = parent->loadDoubleSetting( "SFCave_custom_player_thrust", 0.4 );
+ double gravity = parent->loadDoubleSetting( "SFCave_custom_player_gravity", 0.6 );
+ double maxUp = parent->loadDoubleSetting( "SFCave_custom_player_maxupspeed", 4.0 );
+ double maxDown = parent->loadDoubleSetting( "SFCave_custom_player_maxdownspeed", 5.0 );
+ player->setMovementInfo( thrust, gravity, maxUp, maxDown );
+
+ break;
+ }
}
for ( int i = 0 ; i < BLOCKSIZE ; ++i )
blocks[i].y( -1 );
}
@@ -65,13 +78,12 @@ void SFCaveGame :: update( int state )
blockHeight -= 5;
}
}
if ( checkCollisions() )
{
-// printf( "Crashed!\n" );
parent->changeState( STATE_CRASHING );
return;
}
if ( nrFrames % blockDistance == 0 )
addBlock();