summaryrefslogtreecommitdiff
path: root/noncore/games/sfcave-sdl/fly_game.cpp
authorandyq <andyq>2003-01-21 20:37:00 (UTC)
committer andyq <andyq>2003-01-21 20:37:00 (UTC)
commit0a6563fcc2f49857c581d9def24407a3a4ef526c (patch) (side-by-side diff)
treef1b82a4bd7582ef2cb722cffb87eecff1e1f96e6 /noncore/games/sfcave-sdl/fly_game.cpp
parent50b5915b48fc5cbacf23e4d2b75d7a266f141a4a (diff)
downloadopie-0a6563fcc2f49857c581d9def24407a3a4ef526c.zip
opie-0a6563fcc2f49857c581d9def24407a3a4ef526c.tar.gz
opie-0a6563fcc2f49857c581d9def24407a3a4ef526c.tar.bz2
Clean up of code - fixed memory leaks (most of them) and added new custom config menu
Diffstat (limited to 'noncore/games/sfcave-sdl/fly_game.cpp') (more/less context) (show 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
@@ -18,4 +18,5 @@ FlyGame :: FlyGame( SFCave *p, int w, int h, int diff )
FlyGame :: ~FlyGame()
{
+ // terrain and player get deleted by parent class
}
@@ -35,4 +36,13 @@ void FlyGame :: init()
player->setMovementInfo( 0.4, 0.6, 4, 5 );
break;
+ case MENU_DIFFICULTY_CUSTOM:
+ {
+ double thrust = parent->loadDoubleSetting( "Fly_custom_player_thrust", 0.3 );
+ double gravity = parent->loadDoubleSetting( "Fly_custom_player_gravity", 0.2 );
+ double maxUp = parent->loadDoubleSetting( "Fly_custom_player_maxupspeed", 1.5 );
+ double maxDown = parent->loadDoubleSetting( "Fly_custom_player_maxdownspeed", 1.5 );
+ player->setMovementInfo( thrust, gravity, maxUp, maxDown );
+ break;
+ }
}
@@ -51,5 +61,5 @@ void FlyGame :: update( int state )
int diff = terrain->getMapBottom( 10 ) - player->getY();
int tmpScore = ((FlyTerrain *)terrain)->getScore( 1, diff );
-// printf( "diff - %d score - %d\n", diff, tmpScore );
+
if ( !startScoring )
{
@@ -70,5 +80,4 @@ void FlyGame :: update( int state )
if ( checkCollisions() )
{
-// printf( "Crashed!\n" );
parent->changeState( STATE_CRASHING );
return;