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.cpp | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/noncore/games/sfcave-sdl/fly_game.cpp b/noncore/games/sfcave-sdl/fly_game.cpp index 7605c3f..8b05d8f 100644 --- a/noncore/games/sfcave-sdl/fly_game.cpp +++ b/noncore/games/sfcave-sdl/fly_game.cpp | |||
@@ -13,49 +13,48 @@ FlyGame :: FlyGame( SFCave *p, int w, int h, int diff ) | |||
13 | terrain = new FlyTerrain( w, h ); | 13 | terrain = new FlyTerrain( w, h ); |
14 | player = new Player( w, h ); | 14 | player = new Player( w, h ); |
15 | highScore = 0; | 15 | highScore = 0; |
16 | } | 16 | } |
17 | 17 | ||
18 | FlyGame :: ~FlyGame() | 18 | FlyGame :: ~FlyGame() |
19 | { | 19 | { |
20 | // terrain and player get deleted by parent class | 20 | // terrain and player get deleted by parent class |
21 | } | 21 | } |
22 | 22 | ||
23 | void FlyGame :: init() | 23 | void FlyGame :: init() |
24 | { | 24 | { |
25 | Game :: init(); | ||
26 | |||
27 | switch( difficulty ) | 25 | switch( difficulty ) |
28 | { | 26 | { |
29 | case MENU_DIFFICULTY_EASY: | 27 | case MENU_DIFFICULTY_EASY: |
30 | player->setMovementInfo( 0.3, 0.2, 1.5, 1.5 ); | 28 | player->setMovementInfo( 0.3, 0.2, 1.5, 1.5 ); |
31 | break; | 29 | break; |
32 | case MENU_DIFFICULTY_NORMAL: | 30 | case MENU_DIFFICULTY_NORMAL: |
33 | player->setMovementInfo( 0.35, 0.4, 2.5, 3 ); | 31 | player->setMovementInfo( 0.35, 0.4, 2.5, 3 ); |
34 | break; | 32 | break; |
35 | case MENU_DIFFICULTY_HARD: | 33 | case MENU_DIFFICULTY_HARD: |
36 | player->setMovementInfo( 0.4, 0.6, 4, 5 ); | 34 | player->setMovementInfo( 0.4, 0.6, 4, 5 ); |
37 | break; | 35 | break; |
38 | case MENU_DIFFICULTY_CUSTOM: | 36 | case MENU_DIFFICULTY_CUSTOM: |
39 | { | 37 | { |
40 | double thrust = parent->loadDoubleSetting( "Fly_custom_player_thrust", 0.3 ); | 38 | double thrust = parent->loadDoubleSetting( "Fly_custom_player_thrust", 0.3 ); |
41 | double gravity = parent->loadDoubleSetting( "Fly_custom_player_gravity", 0.2 ); | 39 | double gravity = parent->loadDoubleSetting( "Fly_custom_player_gravity", 0.2 ); |
42 | double maxUp = parent->loadDoubleSetting( "Fly_custom_player_maxupspeed", 1.5 ); | 40 | double maxUp = parent->loadDoubleSetting( "Fly_custom_player_maxupspeed", 1.5 ); |
43 | double maxDown = parent->loadDoubleSetting( "Fly_custom_player_maxdownspeed", 1.5 ); | 41 | double maxDown = parent->loadDoubleSetting( "Fly_custom_player_maxdownspeed", 1.5 ); |
44 | player->setMovementInfo( thrust, gravity, maxUp, maxDown ); | 42 | player->setMovementInfo( thrust, gravity, maxUp, maxDown ); |
45 | break; | 43 | break; |
46 | } | 44 | } |
47 | } | 45 | } |
48 | 46 | ||
49 | startScoring = false; | 47 | startScoring = false; |
48 | Game :: init(); | ||
50 | } | 49 | } |
51 | 50 | ||
52 | void FlyGame :: update( int state ) | 51 | void FlyGame :: update( int state ) |
53 | { | 52 | { |
54 | Game::update( state ); | 53 | Game::update( state ); |
55 | 54 | ||
56 | if ( state == STATE_PLAYING ) | 55 | if ( state == STATE_PLAYING ) |
57 | { | 56 | { |
58 | 57 | ||
59 | if ( nrFrames % 3 == 0 ) | 58 | if ( nrFrames % 3 == 0 ) |
60 | { | 59 | { |
61 | int diff = terrain->getMapBottom( 10 ) - player->getY(); | 60 | int diff = terrain->getMapBottom( 10 ) - player->getY(); |