summaryrefslogtreecommitdiff
path: root/noncore/games/sfcave-sdl/gates_game.cpp
Side-by-side diff
Diffstat (limited to 'noncore/games/sfcave-sdl/gates_game.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/games/sfcave-sdl/gates_game.cpp15
1 files changed, 14 insertions, 1 deletions
diff --git a/noncore/games/sfcave-sdl/gates_game.cpp b/noncore/games/sfcave-sdl/gates_game.cpp
index 1a9bc89..762801d 100644
--- a/noncore/games/sfcave-sdl/gates_game.cpp
+++ b/noncore/games/sfcave-sdl/gates_game.cpp
@@ -19,4 +19,5 @@ GatesGame :: GatesGame( SFCave *p, int w, int h, int diff )
GatesGame :: ~GatesGame()
{
+ // terrain and player get deleted by parent class
}
@@ -47,4 +48,17 @@ void GatesGame :: init()
player->setMovementInfo( 0.6, 0.8, 6, 7 );
break;
+ case MENU_DIFFICULTY_CUSTOM:
+ {
+ // Read custom difficulty settings for this game
+ gapHeight = parent->loadIntSetting( "Gates_custom_gapHeight", 75 );
+
+ double thrust = parent->loadDoubleSetting( "Gates_custom_player_thrust", 0.4 );
+ double gravity = parent->loadDoubleSetting( "Gates_custom_player_gravity", 0.6 );
+ double maxUp = parent->loadDoubleSetting( "Gates_custom_player_maxupspeed", 4.0 );
+ double maxDown = parent->loadDoubleSetting( "Gates_custom_player_maxdownspeed", 5.0 );
+ player->setMovementInfo( thrust, gravity, maxUp, maxDown );
+
+ break;
+ }
}
@@ -78,5 +92,4 @@ void GatesGame :: update( int state )
if ( checkCollisions() )
{
-// printf( "Crashed!\n" );
parent->changeState( STATE_CRASHING );
return;