moon-lander does not start

hello all,

when i start moon-lander 1.0-1039.4 (opensuse 11.3) (but also in previous versions)
the game starts, but stop then during the start-progress. it freezes.

the reason i found out: the config-file “.moon-lander” in the home directory is not build; so the game uses its defaults. BUG: the defaults are not correct, so the game waits a long time…
solution: build a txt-file (.moon-lander) and write this numbers in the
file: 3 1 1 1 1 2
in the actual game there are 6 parameters, in older ones only 5 or less.!!

next bug i fixed, is the problem when backgrund-pics should be loaded.
in the source is a bug: when linux reads the *.jpg from the background-
directory it reads . and … aswell. so the game crashes.
i build a patch, after i expanded the moon-lander-src-rpm.
because i dont know how to report a bug, i post the patch:

--- moon_lander.c_org	2011-06-13 11:39:44.000000000 +0200
+++ moon_lander.c	2011-06-13 10:53:49.000000000 +0200
@@ -209,7 +209,9 @@ void get_new_background(Game *game) {
       if ( (files[count] = readdir(dir)) ){
       
 	//printf("I see - %d %s
", count, files[count]->d_name);
-	count++;
+	if (strlen(files[count]->d_name) > 2) {
+	  count++;
+	}
       }
       else{
 	done = 1;
@@ -309,6 +311,13 @@ void load_game(Game *game){
   char filename[200];
   FILE *file;
 
+  game->opt_num_lives = 3;
+  game->opt_lp_bonus = 1;
+  game->opt_lp_warn = 1;
+  game->opt_prog_grav = 1;
+  game->opt_fancy_terrain = 1;
+  game->opt_frame_period = 2;
+
 #ifndef WIN32_BUILD
   struct passwd *pwp;
 
@@ -344,6 +353,7 @@ void load_game(Game *game){
     game->opt_lp_warn = 1;
     game->opt_prog_grav = 1;
     game->opt_fancy_terrain = 1;
+    game->opt_frame_period = 2;
 
     return;
   }
@@ -365,7 +375,10 @@ void options (Game *game) {
   int value[6];
   Uint8 *key_table;
   SDL_Event event;
-
+  
+  get_new_background(game);
+  SDL_Flip(game->screen);
+  
   sprintf(options[0],"%s", "Fancy Terrain");
   sprintf(options[1],"%s", "Progressive Gravity");
   sprintf(options[2],"%s", "Landing Pad Speed Warning");
@@ -481,6 +494,7 @@ void options (Game *game) {
     DT_DrawText("OPTIONS", game->screen, game->big_font, 260, 50);
     DT_DrawText("Arrow Keys Select", game->screen, game->small_font, 260, 75);
     DT_DrawText("ENTER changes value", game->screen, game->small_font, 260, 90);
+    DT_DrawText("ESC back to game", game->screen, game->small_font, 260, 105);
 
     for (count = 0; count < 6; count ++) {
 
@@ -889,7 +903,7 @@ void game_over(Game *game, int first_tim
   }
 
   if (first_time == 0){
-  /* if they just lost, show them thier score and stuff and then pause for a sec */
+  /* if they just lost, show them their score and stuff and then pause for a sec */
     draw_sprite(game->screen, game->gameover_screen);
     draw_sprite(game->screen, game->logo);
     DT_DrawText("Game Over", game->screen, game->big_font, 252, 148 ); 
@@ -897,7 +911,7 @@ void game_over(Game *game, int first_tim
     draw_sprite(game->screen, game->magigames);
 
     SDL_Flip(game->screen);
-    delay(75);
+    delay(125);
   }
 
   /* start between game animation */
@@ -916,15 +930,15 @@ void game_over(Game *game, int first_tim
 
     /* if they just lost, show them thier score and stuff */
 
-    if (first_time == 0){
-      DT_DrawText("Game Over", game->screen, game->big_font, 252, 148 ); 
-    }
+//    if (first_time == 0){
+//      DT_DrawText("Game Over", game->screen, game->big_font, 252, 248 ); 
+//    }
 
     draw_score(game, 0);
     DT_DrawText("Arrow keys control the ship", game->screen, game->big_font, 100, 100 );
     DT_DrawText("Q quit   P pause   ESC options", game->screen, game->big_font, 75, 125 );
     DT_DrawText("A autopilot   F flight director", game->screen, game->big_font, 75, 150 );
-    DT_DrawText("Press ENTER to play", game->screen, game->big_font, 175, 170 );
+    DT_DrawText("Press ENTER to play", game->screen, game->big_font, 175, 175 );
 
     DT_DrawText("Score for each round = landing pad score + remaining fuel.", game->screen, game->small_font, 150, 280 );
     DT_DrawText("Safe Landing requires X velocity < 0.5 and Y velocity < indicated by landing pad color.", game->screen, game->small_font, 55, 300 );
@@ -1092,7 +1106,7 @@ void new_round(Game *game, int died_won)
 
     game->fuel = game->current_level.fuel;
 
-    /* prograssive gravity if on */
+    /* progressive gravity if on */
     if (game->opt_prog_grav){
       game->gravity = 0.05 + (game->difficulty * 0.001 );
     }

have much fun

uli

Welcome here, and thanks for posting. Maybe you should contact the openSUSE devs, or create an OBS account to provide others with a patched package of your own. openSUSE is more than a distro !!

Hello all,

i managed to send a bug report to Opensuse. It´ s now a official bug.
Have a lot of fun
Uli

Hi,

The main codebase seems that its no longer maintained (MagiGames.org), and the patch should actually be submitted to them. I will inform the maintainer of this package about this so he can review the code and take the action he believes necessary.

I’ll let you know something (though an update on the next days would eventually point that is has been accepted).

NM

I have tested the original package, and yes, it does have a significative number of issues. For me it just stalls on the main screen.

I’ve build the game from source with your patch, and it does fix the issues. I’m submitting this for review with all the information your provided and wait for feedback from the maintainer of the package.
I’ll let ya know once it’s updated. Please leave just the number of the bug report on http://bugzilla.novell.com (I suppose you opened it there) so I can handle it.

Thanks for bringing this into our attention and for submitting the patch.

NM

Updated on games, bnc#699598 closed.

hello all,

yes, it´s the bug report 699598. reported by opensuse bugzilla.
Thanks a lot for all the help!

Uli

hello all,

the bug is solved, a playable game can be downloaded througth the repositories.

Have a lot of fun (with the game)

uli

hello,

for all the people out there who like to play the game in its best state, here´s the latest (and best) patch i can do:


--- moon_lander.c_org	2011-06-13 11:39:44.000000000 +0200
+++ moon_lander.c	2011-06-15 20:40:49.000000000 +0200
@@ -209,7 +209,9 @@ void get_new_background(Game *game) {
       if ( (files[count] = readdir(dir)) ){
       
 	//printf("I see - %d %s
", count, files[count]->d_name);
-	count++;
+	if ((strchr(files[count]->d_name, '.') - files[count]->d_name) > 0) {
+	  count++;
+	}
       }
       else{
 	done = 1;
@@ -231,15 +233,17 @@ void get_new_background(Game *game) {
 
   
 
-  game->back_no++;
-  
-  if (game->back_no < 2){
-    game->back_no = 2;
-  }
-
-  if (game->back_no >= count){
-    game->back_no = 2;
-  }
+  //game->back_no++;
+  srand( (unsigned) time(NULL) ) ; 
+  game->back_no = 0 + ( rand() % (count));         //a + ( rand() % ( b - a + 1))     a=0, b=count-1
+    
+//  if (game->back_no < 0){
+//    game->back_no = 0;
+//  }
+
+//  if (game->back_no >= count){
+//    game->back_no = 0;
+//  }  
   
 
   if (game->background.image != NULL){
@@ -309,6 +313,13 @@ void load_game(Game *game){
   char filename[200];
   FILE *file;
 
+  game->opt_num_lives = 3;
+  game->opt_lp_bonus = 1;
+  game->opt_lp_warn = 1;
+  game->opt_prog_grav = 1;
+  game->opt_fancy_terrain = 1;
+  game->opt_frame_period = 2;
+
 #ifndef WIN32_BUILD
   struct passwd *pwp;
 
@@ -344,6 +355,7 @@ void load_game(Game *game){
     game->opt_lp_warn = 1;
     game->opt_prog_grav = 1;
     game->opt_fancy_terrain = 1;
+    game->opt_frame_period = 2;
 
     return;
   }
@@ -365,7 +377,10 @@ void options (Game *game) {
   int value[6];
   Uint8 *key_table;
   SDL_Event event;
-
+  
+  get_new_background(game);
+  SDL_Flip(game->screen);
+  
   sprintf(options[0],"%s", "Fancy Terrain");
   sprintf(options[1],"%s", "Progressive Gravity");
   sprintf(options[2],"%s", "Landing Pad Speed Warning");
@@ -481,6 +496,7 @@ void options (Game *game) {
     DT_DrawText("OPTIONS", game->screen, game->big_font, 260, 50);
     DT_DrawText("Arrow Keys Select", game->screen, game->small_font, 260, 75);
     DT_DrawText("ENTER changes value", game->screen, game->small_font, 260, 90);
+    DT_DrawText("ESC back to game", game->screen, game->small_font, 260, 105);
 
     for (count = 0; count < 6; count ++) {
 
@@ -878,7 +894,7 @@ void game_over(Game *game, int first_tim
   int ticks = 0;
   Uint8 *key_table;
   int l_start;
-
+  char display_string[100];
 
   if( game->demo_mode ) {
     first_time = 1;
@@ -889,15 +905,17 @@ void game_over(Game *game, int first_tim
   }
 
   if (first_time == 0){
-  /* if they just lost, show them thier score and stuff and then pause for a sec */
+  /* if they just lost, show them their score and stuff and then pause for a sec */
     draw_sprite(game->screen, game->gameover_screen);
     draw_sprite(game->screen, game->logo);
     DT_DrawText("Game Over", game->screen, game->big_font, 252, 148 ); 
+    sprintf(display_string, "Score: %d", (game->score));
+    DT_DrawText(display_string, game->screen, game->big_font, 240, 190 );
     draw_score(game, 0);
     draw_sprite(game->screen, game->magigames);
 
     SDL_Flip(game->screen);
-    delay(75);
+    delay(125);
   }
 
   /* start between game animation */
@@ -916,15 +934,15 @@ void game_over(Game *game, int first_tim
 
     /* if they just lost, show them thier score and stuff */
 
-    if (first_time == 0){
-      DT_DrawText("Game Over", game->screen, game->big_font, 252, 148 ); 
-    }
+//    if (first_time == 0){
+//      DT_DrawText("Game Over", game->screen, game->big_font, 252, 248 ); 
+//    }
 
     draw_score(game, 0);
     DT_DrawText("Arrow keys control the ship", game->screen, game->big_font, 100, 100 );
     DT_DrawText("Q quit   P pause   ESC options", game->screen, game->big_font, 75, 125 );
     DT_DrawText("A autopilot   F flight director", game->screen, game->big_font, 75, 150 );
-    DT_DrawText("Press ENTER to play", game->screen, game->big_font, 175, 170 );
+    DT_DrawText("Press ENTER to play", game->screen, game->big_font, 175, 175 );
 
     DT_DrawText("Score for each round = landing pad score + remaining fuel.", game->screen, game->small_font, 150, 280 );
     DT_DrawText("Safe Landing requires X velocity < 0.5 and Y velocity < indicated by landing pad color.", game->screen, game->small_font, 55, 300 );
@@ -1092,7 +1110,7 @@ void new_round(Game *game, int died_won)
 
     game->fuel = game->current_level.fuel;
 
-    /* prograssive gravity if on */
+    /* progressive gravity if on */
     if (game->opt_prog_grav){
       game->gravity = 0.05 + (game->difficulty * 0.001 );
     }
@@ -1794,7 +1812,7 @@ void gameloop(Game *game){
 	  sprintf(display_string, "**PAUSED**"); 
 	    
 	  if (game->small_font > -1){
-	    DT_DrawText(display_string, game->screen, game->small_font, 300, 20);
+	    DT_DrawText(display_string, game->screen, game->small_font, 300, 40);
 	  }
 	}
       }

Have a lot of fun with the game :wink:

Uli