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