summaryrefslogtreecommitdiff
path: root/noncore/games/sfcave-sdl/gates_game.cpp
Unidiff
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.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/noncore/games/sfcave-sdl/gates_game.cpp b/noncore/games/sfcave-sdl/gates_game.cpp
index 762801d..700a6ec 100644
--- a/noncore/games/sfcave-sdl/gates_game.cpp
+++ b/noncore/games/sfcave-sdl/gates_game.cpp
@@ -14,26 +14,24 @@ GatesGame :: GatesGame( SFCave *p, int w, int h, int diff )
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
19GatesGame :: ~GatesGame() 19GatesGame :: ~GatesGame()
20{ 20{
21 // terrain and player get deleted by parent class 21 // terrain and player get deleted by parent class
22} 22}
23 23
24void GatesGame :: init() 24void GatesGame :: init()
25{ 25{
26 Game :: init();
27
28 blockHeight = 80; 26 blockHeight = 80;
29 blockWidth = 20; 27 blockWidth = 20;
30 lastGateBottomY = 0; 28 lastGateBottomY = 0;
31 29
32 gateDistance = 75; 30 gateDistance = 75;
33 nextGate = nextInt( 50 ) + gateDistance; 31 nextGate = nextInt( 50 ) + gateDistance;
34 gapHeight = 75; 32 gapHeight = 75;
35 33
36 switch( difficulty ) 34 switch( difficulty )
37 { 35 {
38 case MENU_DIFFICULTY_EASY: 36 case MENU_DIFFICULTY_EASY:
39 gapHeight = 75; 37 gapHeight = 75;
@@ -55,24 +53,26 @@ void GatesGame :: init()
55 double thrust = parent->loadDoubleSetting( "Gates_custom_player_thrust", 0.4 ); 53 double thrust = parent->loadDoubleSetting( "Gates_custom_player_thrust", 0.4 );
56 double gravity = parent->loadDoubleSetting( "Gates_custom_player_gravity", 0.6 ); 54 double gravity = parent->loadDoubleSetting( "Gates_custom_player_gravity", 0.6 );
57 double maxUp = parent->loadDoubleSetting( "Gates_custom_player_maxupspeed", 4.0 ); 55 double maxUp = parent->loadDoubleSetting( "Gates_custom_player_maxupspeed", 4.0 );
58 double maxDown = parent->loadDoubleSetting( "Gates_custom_player_maxdownspeed", 5.0 ); 56 double maxDown = parent->loadDoubleSetting( "Gates_custom_player_maxdownspeed", 5.0 );
59 player->setMovementInfo( thrust, gravity, maxUp, maxDown ); 57 player->setMovementInfo( thrust, gravity, maxUp, maxDown );
60 58
61 break; 59 break;
62 } 60 }
63 } 61 }
64 62
65 for ( int i = 0 ; i < BLOCKSIZE ; ++i ) 63 for ( int i = 0 ; i < BLOCKSIZE ; ++i )
66 blocks[i].y( -1 ); 64 blocks[i].y( -1 );
65
66 Game :: init();
67} 67}
68 68
69void GatesGame :: update( int state ) 69void GatesGame :: update( int state )
70{ 70{
71 Game::update( state ); 71 Game::update( state );
72 72
73 // Game logic goes here 73 // Game logic goes here
74 if ( state == STATE_PLAYING ) 74 if ( state == STATE_PLAYING )
75 { 75 {
76 if ( nrFrames % 3 == 0 ) 76 if ( nrFrames % 3 == 0 )
77 score ++; 77 score ++;
78 78