summaryrefslogtreecommitdiff
path: root/noncore/games/sfcave-sdl/fly_game.cpp
Unidiff
Diffstat (limited to 'noncore/games/sfcave-sdl/fly_game.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/games/sfcave-sdl/fly_game.cpp13
1 files changed, 11 insertions, 2 deletions
diff --git a/noncore/games/sfcave-sdl/fly_game.cpp b/noncore/games/sfcave-sdl/fly_game.cpp
index f5ab401..7605c3f 100644
--- a/noncore/games/sfcave-sdl/fly_game.cpp
+++ b/noncore/games/sfcave-sdl/fly_game.cpp
@@ -17,6 +17,7 @@ FlyGame :: FlyGame( SFCave *p, int w, int h, int diff )
17 17
18FlyGame :: ~FlyGame() 18FlyGame :: ~FlyGame()
19{ 19{
20 // terrain and player get deleted by parent class
20} 21}
21 22
22void FlyGame :: init() 23void FlyGame :: init()
@@ -34,6 +35,15 @@ void FlyGame :: init()
34 case MENU_DIFFICULTY_HARD: 35 case MENU_DIFFICULTY_HARD:
35 player->setMovementInfo( 0.4, 0.6, 4, 5 ); 36 player->setMovementInfo( 0.4, 0.6, 4, 5 );
36 break; 37 break;
38 case MENU_DIFFICULTY_CUSTOM:
39 {
40 double thrust = parent->loadDoubleSetting( "Fly_custom_player_thrust", 0.3 );
41 double gravity = parent->loadDoubleSetting( "Fly_custom_player_gravity", 0.2 );
42 double maxUp = parent->loadDoubleSetting( "Fly_custom_player_maxupspeed", 1.5 );
43 double maxDown = parent->loadDoubleSetting( "Fly_custom_player_maxdownspeed", 1.5 );
44 player->setMovementInfo( thrust, gravity, maxUp, maxDown );
45 break;
46 }
37 } 47 }
38 48
39 startScoring = false; 49 startScoring = false;
@@ -50,7 +60,7 @@ void FlyGame :: update( int state )
50 { 60 {
51 int diff = terrain->getMapBottom( 10 ) - player->getY(); 61 int diff = terrain->getMapBottom( 10 ) - player->getY();
52 int tmpScore = ((FlyTerrain *)terrain)->getScore( 1, diff ); 62 int tmpScore = ((FlyTerrain *)terrain)->getScore( 1, diff );
53 // printf( "diff - %d score - %d\n", diff, tmpScore ); 63
54 if ( !startScoring ) 64 if ( !startScoring )
55 { 65 {
56 if ( tmpScore > 0 ) 66 if ( tmpScore > 0 )
@@ -69,7 +79,6 @@ void FlyGame :: update( int state )
69 79
70 if ( checkCollisions() ) 80 if ( checkCollisions() )
71 { 81 {
72 // printf( "Crashed!\n" );
73 parent->changeState( STATE_CRASHING ); 82 parent->changeState( STATE_CRASHING );
74 return; 83 return;
75 } 84 }