summaryrefslogtreecommitdiff
authorandyq <andyq>2003-01-21 21:09:36 (UTC)
committer andyq <andyq>2003-01-21 21:09:36 (UTC)
commit6b3b53262213e4e4f73ffab2266ea3b4a7813fe4 (patch) (unidiff)
tree896759614d5601570f259525c000a8be4db4d68d
parent0a6563fcc2f49857c581d9def24407a3a4ef526c (diff)
downloadopie-6b3b53262213e4e4f73ffab2266ea3b4a7813fe4.zip
opie-6b3b53262213e4e4f73ffab2266ea3b4a7813fe4.tar.gz
opie-6b3b53262213e4e4f73ffab2266ea3b4a7813fe4.tar.bz2
Small bug fix
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/games/sfcave-sdl/fly_game.cpp3
-rw-r--r--noncore/games/sfcave-sdl/gates_game.cpp4
-rw-r--r--noncore/games/sfcave-sdl/player.cpp2
-rw-r--r--noncore/games/sfcave-sdl/sfcave_game.cpp4
4 files changed, 6 insertions, 7 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
@@ -17,18 +17,16 @@ 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 // terrain and player get deleted by parent class
21} 21}
22 22
23void FlyGame :: init() 23void 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;
@@ -42,16 +40,17 @@ void FlyGame :: init()
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
52void FlyGame :: update( int state ) 51void 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 {
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
@@ -18,18 +18,16 @@ GatesGame :: GatesGame( SFCave *p, int w, int h, int diff )
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
@@ -59,16 +57,18 @@ void GatesGame :: init()
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 )
diff --git a/noncore/games/sfcave-sdl/player.cpp b/noncore/games/sfcave-sdl/player.cpp
index 2d52ae2..f024d6b 100644
--- a/noncore/games/sfcave-sdl/player.cpp
+++ b/noncore/games/sfcave-sdl/player.cpp
@@ -28,17 +28,17 @@ Player :: ~Player()
28 28
29void Player :: init() 29void Player :: init()
30{ 30{
31 // Set player position 31 // Set player position
32 pos.x( 50 ); 32 pos.x( 50 );
33 pos.y( sWidth/2 ); 33 pos.y( sWidth/2 );
34 pos.h( 2 ); 34 pos.h( 2 );
35 pos.w( 4 ); 35 pos.w( 4 );
36 thrust = 0; 36 currentThrust = 0;
37 crashing = false; 37 crashing = false;
38 crashLineLength = 0; 38 crashLineLength = 0;
39 crashed = false; 39 crashed = false;
40 explosion->reset(); 40 explosion->reset();
41 allFaded = false; 41 allFaded = false;
42 expNextFrame = false; 42 expNextFrame = false;
43 43
44 // Reset Trail 44 // Reset Trail
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
@@ -17,18 +17,16 @@ SFCaveGame :: SFCaveGame( SFCave *p, int w, int h, int diff )
17} 17}
18 18
19SFCaveGame :: ~SFCaveGame() 19SFCaveGame :: ~SFCaveGame()
20{ 20{
21} 21}
22 22
23void SFCaveGame :: init() 23void 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;
@@ -51,16 +49,18 @@ void SFCaveGame :: init()
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
61void SFCaveGame :: update( int state ) 61void 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 {