Diffstat (limited to 'noncore/games/sfcave-sdl/sfcave_game.cpp') (more/less context) (show whitespace changes)
-rw-r--r-- | noncore/games/sfcave-sdl/sfcave_game.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/noncore/games/sfcave-sdl/sfcave_game.cpp b/noncore/games/sfcave-sdl/sfcave_game.cpp index 1b00e14..8fdbbe5 100644 --- a/noncore/games/sfcave-sdl/sfcave_game.cpp +++ b/noncore/games/sfcave-sdl/sfcave_game.cpp | |||
@@ -13,26 +13,24 @@ SFCaveGame :: SFCaveGame( SFCave *p, int w, int h, int diff ) | |||
13 | 13 | ||
14 | terrain = new Terrain( w, h ); | 14 | terrain = new Terrain( w, h ); |
15 | player = new Player( w, h ); | 15 | player = new Player( w, h ); |
16 | highScore = 0; | 16 | highScore = 0; |
17 | } | 17 | } |
18 | 18 | ||
19 | SFCaveGame :: ~SFCaveGame() | 19 | SFCaveGame :: ~SFCaveGame() |
20 | { | 20 | { |
21 | } | 21 | } |
22 | 22 | ||
23 | void SFCaveGame :: init() | 23 | void SFCaveGame :: init() |
24 | { | 24 | { |
25 | Game :: init(); | ||
26 | |||
27 | blockDistance = 50; | 25 | blockDistance = 50; |
28 | blockHeight = 80; | 26 | blockHeight = 80; |
29 | blockWidth = 20; | 27 | blockWidth = 20; |
30 | 28 | ||
31 | switch( difficulty ) | 29 | switch( difficulty ) |
32 | { | 30 | { |
33 | case MENU_DIFFICULTY_EASY: | 31 | case MENU_DIFFICULTY_EASY: |
34 | blockDistance = 50; | 32 | blockDistance = 50; |
35 | break; | 33 | break; |
36 | case MENU_DIFFICULTY_NORMAL: | 34 | case MENU_DIFFICULTY_NORMAL: |
37 | blockDistance = 40; | 35 | blockDistance = 40; |
38 | break; | 36 | break; |
@@ -47,24 +45,26 @@ void SFCaveGame :: init() | |||
47 | double thrust = parent->loadDoubleSetting( "SFCave_custom_player_thrust", 0.4 ); | 45 | double thrust = parent->loadDoubleSetting( "SFCave_custom_player_thrust", 0.4 ); |
48 | double gravity = parent->loadDoubleSetting( "SFCave_custom_player_gravity", 0.6 ); | 46 | double gravity = parent->loadDoubleSetting( "SFCave_custom_player_gravity", 0.6 ); |
49 | double maxUp = parent->loadDoubleSetting( "SFCave_custom_player_maxupspeed", 4.0 ); | 47 | double maxUp = parent->loadDoubleSetting( "SFCave_custom_player_maxupspeed", 4.0 ); |
50 | double maxDown = parent->loadDoubleSetting( "SFCave_custom_player_maxdownspeed", 5.0 ); | 48 | double maxDown = parent->loadDoubleSetting( "SFCave_custom_player_maxdownspeed", 5.0 ); |
51 | player->setMovementInfo( thrust, gravity, maxUp, maxDown ); | 49 | player->setMovementInfo( thrust, gravity, maxUp, maxDown ); |
52 | 50 | ||
53 | break; | 51 | break; |
54 | } | 52 | } |
55 | } | 53 | } |
56 | 54 | ||
57 | for ( int i = 0 ; i < BLOCKSIZE ; ++i ) | 55 | for ( int i = 0 ; i < BLOCKSIZE ; ++i ) |
58 | blocks[i].y( -1 ); | 56 | blocks[i].y( -1 ); |
57 | |||
58 | Game :: init(); | ||
59 | } | 59 | } |
60 | 60 | ||
61 | void SFCaveGame :: update( int state ) | 61 | void SFCaveGame :: update( int state ) |
62 | { | 62 | { |
63 | Game::update( state ); | 63 | Game::update( state ); |
64 | 64 | ||
65 | if ( state == STATE_PLAYING ) | 65 | if ( state == STATE_PLAYING ) |
66 | { | 66 | { |
67 | if ( nrFrames % 3 == 0 ) | 67 | if ( nrFrames % 3 == 0 ) |
68 | score ++; | 68 | score ++; |
69 | 69 | ||
70 | if ( nrFrames % 200 == 0 ) | 70 | if ( nrFrames % 200 == 0 ) |