From: Bill Kendrick Date: Wed, 10 Dec 2003 07:38:52 +0000 (+0000) Subject: Lots of updates! Level 2 support, mostly. (Thanks, Tobias Glaesser) X-Git-Url: https://git.verplant.org/?a=commitdiff_plain;h=6a189fa082c146f1a2532d2945bd2f6fec059bb4;p=supertux.git Lots of updates! Level 2 support, mostly. (Thanks, Tobias Glaesser) SVN-Revision: 9 --- diff --git a/AUTHORS.txt b/AUTHORS.txt index ec5b85fe8..84c93954f 100644 --- a/AUTHORS.txt +++ b/AUTHORS.txt @@ -4,9 +4,9 @@ by Bill Kendrick bill@newbreedsoftware.com http://www.newbreedsoftware.com/supertux/ -Version 0.0.2 +Version 0.0.5 -August 6, 2001 +December 9, 2003 CREDITS @@ -14,6 +14,8 @@ CREDITS Game Software: Bill Kendrick, http://www.newbreedsoftware.com/bill/ + Tobias Glaesser + Graphics: Bill Kendrick, using The GIMP http://www.gimp.org/ diff --git a/CHANGES.txt b/CHANGES.txt index 6e4526c6e..59cfcc11a 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -14,6 +14,29 @@ http://www.newbreedsoftware.com/supertux/ * Sped up FPS (throttle) + * Adding a new level (level,images,music) should be very easy now! + Tobias Glaesser + + * Shooting enemies increases score + Tobias Glaesser + + * Game over sequence. + Tobias Glaesser + + * Added 'make install PREFIX=/usr' and 'make uninstall PREFIX=/usr' + Tobias Glaesser + + * Initial support for additional levels. + Tobias Glaesser + + * Added small "Level 2" + Tobias Glaesser + + * One-ups ever 100 distros + Tobias Glaesser + + * Fixed up Makefile + 0.0.4 - July 15, 2002 --------------------- diff --git a/Makefile b/Makefile index 05dd31942..c66631efa 100644 --- a/Makefile +++ b/Makefile @@ -4,14 +4,15 @@ # bill@newbreedsoftware.com # http://www.newbreedsoftware.com/ -# Version 0.0.0 +# Version 0.0.5 -# April 11, 2000 - December 26, 2000 +# April 11, 2000 - December 9, 2003 # User-definable stuff: -DATA_PREFIX=$(PWD)/data +PREFIX=/usr/local/ +DATA_PREFIX=$(PREFIX)supertux/ JOY=YES @@ -44,9 +45,14 @@ OBJECTS=obj/supertux.o obj/setup.o obj/intro.o obj/title.o obj/gameloop.o \ all: $(TARGET) -#install: $(TARGET) -# -$(installdat) data $(DESTDIR)/usr/share/games/$(TARGET)/data -# -$(installbin) $(TARGET) $(DESTDIR)/usr/games/ +install: $(TARGET) + -mkdir -p $(DATA_PREFIX) + cp -R data/* $(DATA_PREFIX) + chown -R root.root $(DATA_PREFIX) + chmod -R a+rX $(DATA_PREFIX) + cp $(TARGET) $(PREFIX)bin/ + chown root.root $(PREFIX)bin/$(TARGET) + chmod a+rx $(PREFIX)bin/$(TARGET) nosound: diff --git a/README.txt b/README.txt index ed4321b4e..bdb2e22be 100644 --- a/README.txt +++ b/README.txt @@ -4,9 +4,9 @@ by Bill Kendrick bill@newbreedsoftware.com http://www.newbreedsoftware.com/supertux/ -Version 0.0.3 +Version 0.0.5 -November 14, 2001 +December 9, 2003 NOTICE! THIS GAME IS UNDER CONSTRUCTION! @@ -14,7 +14,7 @@ Things you'll notice: Bugs Documentation is quite incomplete - Only one level + Only two levels DESCRIPTION diff --git a/TODO.txt b/TODO.txt index f73b8c4b4..b21cc16ed 100644 --- a/TODO.txt +++ b/TODO.txt @@ -4,9 +4,9 @@ by Bill Kendrick bill@newbreedsoftware.com http://www.newbreedsoftware.com/supertux/ -Version 0.0.3 +Version 0.0.5 -November 25, 2001 +December 9, 2003 TO DO @@ -16,6 +16,6 @@ TO DO More enemies Redo laptop enemy graphics More levels - Play as Gown, resucing Tux - Game over + Play as Gown, rescuing Tux + End game on game over High score diff --git a/data/images/level2/bkgd-00.png b/data/images/level2/bkgd-00.png new file mode 100644 index 000000000..1491f7439 Binary files /dev/null and b/data/images/level2/bkgd-00.png differ diff --git a/data/images/level2/bkgd-01.png b/data/images/level2/bkgd-01.png new file mode 100644 index 000000000..0428142d0 Binary files /dev/null and b/data/images/level2/bkgd-01.png differ diff --git a/data/images/level2/bkgd-02.png b/data/images/level2/bkgd-02.png new file mode 100644 index 000000000..3fe0f2a21 Binary files /dev/null and b/data/images/level2/bkgd-02.png differ diff --git a/data/images/level2/bkgd-03.png b/data/images/level2/bkgd-03.png new file mode 100644 index 000000000..49a011e84 Binary files /dev/null and b/data/images/level2/bkgd-03.png differ diff --git a/data/images/level2/bkgd-10.png b/data/images/level2/bkgd-10.png new file mode 100644 index 000000000..cd6e20256 Binary files /dev/null and b/data/images/level2/bkgd-10.png differ diff --git a/data/images/level2/bkgd-11.png b/data/images/level2/bkgd-11.png new file mode 100644 index 000000000..734bb814a Binary files /dev/null and b/data/images/level2/bkgd-11.png differ diff --git a/data/images/level2/bkgd-12.png b/data/images/level2/bkgd-12.png new file mode 100644 index 000000000..9ba20d7c9 Binary files /dev/null and b/data/images/level2/bkgd-12.png differ diff --git a/data/images/level2/bkgd-13.png b/data/images/level2/bkgd-13.png new file mode 100644 index 000000000..c642394cf Binary files /dev/null and b/data/images/level2/bkgd-13.png differ diff --git a/data/images/level2/brick0.png b/data/images/level2/brick0.png new file mode 100644 index 000000000..bc11142f5 Binary files /dev/null and b/data/images/level2/brick0.png differ diff --git a/data/images/level2/brick1.png b/data/images/level2/brick1.png new file mode 100644 index 000000000..32c9545c6 Binary files /dev/null and b/data/images/level2/brick1.png differ diff --git a/data/images/level2/solid0.png b/data/images/level2/solid0.png new file mode 100644 index 000000000..640c1bab5 Binary files /dev/null and b/data/images/level2/solid0.png differ diff --git a/data/images/level2/solid1.png b/data/images/level2/solid1.png new file mode 100644 index 000000000..d6ebcb325 Binary files /dev/null and b/data/images/level2/solid1.png differ diff --git a/data/images/level2/solid2.png b/data/images/level2/solid2.png new file mode 100644 index 000000000..95db64a12 Binary files /dev/null and b/data/images/level2/solid2.png differ diff --git a/data/images/level2/solid3.png b/data/images/level2/solid3.png new file mode 100644 index 000000000..0455f9f78 Binary files /dev/null and b/data/images/level2/solid3.png differ diff --git a/data/levels/level1.dat b/data/levels/level1.dat index 63c915eb4..b65155d8f 100644 --- a/data/levels/level1.dat +++ b/data/levels/level1.dat @@ -1,6 +1,10 @@ +Antarctica +255 +j_turn.it 128 192 255 +375 ......cdef......2.........................................cdef.........................................................CDEF.....................................cdedef..........................................................CDEF........................................................................cdef..............cf....................................................cde .......................................................................................................................cdef.....................................................................................................cdef................................................................................................................................................... ......................CDEF........................................CDEF.......................................................................CDEF....................................CDEF.......................................................................................................CDEDEF................................................................[.........*...... diff --git a/data/levels/level1.dat-old b/data/levels/level1.dat-old deleted file mode 100644 index b6a073d54..000000000 --- a/data/levels/level1.dat-old +++ /dev/null @@ -1,18 +0,0 @@ -64 -96 -255 -ef.....................................................................cdef................................................................................................................................................................................................................[===============].........cdef............................................................. -............................................................................................................................................................................................................................................................................................#################DEF....................................................................... -........CDEF....................................................................................................CDEF........................................................................................................................................................................#################def....................................................................... -........cdef..............................$.$.$.................................................................cdef....CDEF........................................................................................CDEF.....................................CDEF...........................#################.......................................................................... -............................................................................................CDEF........................cdef............................CDEF........................................................cdef.....................................cdef...........................#################.......................................................................... -.........................................YYYYYYy............................................cdef........................................................cdef............................................................................................................CDEF................#################.......................................................................... -......................................................................................................................................................................................................Y.................................................................cdef................#################.......................................................................... -......................................................CDEF..........................................................!.......................................................CDEF.............CDEF.........Y.................................................................................#################................CDEF...................................................... -........YAYBY........................YYYyXX.........[===]f.......................0.0.....................................................................................[====]f.............cdef....Y...............................=....................................................CD#################................cdef...................................................... -....................................................#####..................YYYYAYBYYY...................................................................................[######]...........................y.........................#DEF.................................................cd#################.......................................................................... -....................................................#####........................................[=]...........................###.....................................[########]...................Y..............................=.#def......................YYYYYY.......................#################.......................................................................... -.....YYYXXXXXYYY.................YYYYXXX...........[#####............0.0.0.......................###.........[=].........[=]...###...............=....................[##########]..........................Y......................#.#...........YYAYAYAYY.....XXXXXX.................................................................................................................. -...................YYY====YYYY.....................#######################==]....................###...[=]...###.........###...###...............#...................[############]..............................................=.#.#.........................XXXXXX.......................#################.......................................................................... -...................................0.0.0...........######...................#################....###...###...###...[=]...###...###....###........#...0.0.0..........[##############]..................................0.0........#.#.#.........................XXXXXX.................0.0...#################.......................................................................... -===================================================######^^^^^^^^^^^^^^^^^^^#################====###===###===###===###...###...###.........======#==================################==========####################################.#.#========================================]...[==================================================================================================== diff --git a/data/levels/level2.dat b/data/levels/level2.dat new file mode 100644 index 000000000..663afa3fb --- /dev/null +++ b/data/levels/level2.dat @@ -0,0 +1,22 @@ +Australia +240 +SALCON.MOD +128 +192 +255 +28 +......cddddeeeeeef......cdef +............................ +............................ +............................ +............................ +............................ +..#.#.#.....#.#.#........... +............................ +............................ +..............###........... +...........###...######..... +........###...........####.. +.....####................... +..GHIJ......GHIJ............ +=======&&&&&&&&&&&========== diff --git a/data/levels/level3.dat b/data/levels/level3.dat new file mode 100644 index 000000000..79eed2eaa --- /dev/null +++ b/data/levels/level3.dat @@ -0,0 +1 @@ +India diff --git a/data/levels/level4.dat b/data/levels/level4.dat new file mode 100644 index 000000000..21840b3e1 --- /dev/null +++ b/data/levels/level4.dat @@ -0,0 +1 @@ +Egypt diff --git a/data/levels/level5.dat b/data/levels/level5.dat new file mode 100644 index 000000000..b01b79841 --- /dev/null +++ b/data/levels/level5.dat @@ -0,0 +1 @@ +Greece diff --git a/data/levels/level6.dat b/data/levels/level6.dat new file mode 100644 index 000000000..d7c7fd4f1 --- /dev/null +++ b/data/levels/level6.dat @@ -0,0 +1 @@ +Spain diff --git a/data/levels/level7.dat b/data/levels/level7.dat new file mode 100644 index 000000000..23f2ca702 --- /dev/null +++ b/data/levels/level7.dat @@ -0,0 +1 @@ +Brazil diff --git a/data/levels/level8.dat b/data/levels/level8.dat new file mode 100644 index 000000000..551d93d69 --- /dev/null +++ b/data/levels/level8.dat @@ -0,0 +1 @@ +America diff --git a/data/levels/level9.dat b/data/levels/level9.dat new file mode 100644 index 000000000..5cf9203c8 --- /dev/null +++ b/data/levels/level9.dat @@ -0,0 +1 @@ +Redmond diff --git a/data/sounds/old/bigjump.wav b/data/sounds/old/bigjump.wav deleted file mode 100644 index ab03fcbb9..000000000 Binary files a/data/sounds/old/bigjump.wav and /dev/null differ diff --git a/data/sounds/old/brick.wav b/data/sounds/old/brick.wav deleted file mode 100644 index fc186f648..000000000 Binary files a/data/sounds/old/brick.wav and /dev/null differ diff --git a/data/sounds/old/bump-upgrade.wav b/data/sounds/old/bump-upgrade.wav deleted file mode 100644 index 00bfb9d7d..000000000 Binary files a/data/sounds/old/bump-upgrade.wav and /dev/null differ diff --git a/data/sounds/old/coffee.wav b/data/sounds/old/coffee.wav deleted file mode 100644 index 2e2be45eb..000000000 Binary files a/data/sounds/old/coffee.wav and /dev/null differ diff --git a/data/sounds/old/distro.wav b/data/sounds/old/distro.wav deleted file mode 100644 index 5741f232b..000000000 Binary files a/data/sounds/old/distro.wav and /dev/null differ diff --git a/data/sounds/old/excellent.wav b/data/sounds/old/excellent.wav deleted file mode 100644 index cadcc5ee7..000000000 Binary files a/data/sounds/old/excellent.wav and /dev/null differ diff --git a/data/sounds/old/fall.wav b/data/sounds/old/fall.wav deleted file mode 100644 index 292e5c36e..000000000 Binary files a/data/sounds/old/fall.wav and /dev/null differ diff --git a/data/sounds/old/herring.wav b/data/sounds/old/herring.wav deleted file mode 100644 index 96f3871c1..000000000 Binary files a/data/sounds/old/herring.wav and /dev/null differ diff --git a/data/sounds/old/hurt.wav b/data/sounds/old/hurt.wav deleted file mode 100644 index b8e95caca..000000000 Binary files a/data/sounds/old/hurt.wav and /dev/null differ diff --git a/data/sounds/old/jump.wav b/data/sounds/old/jump.wav deleted file mode 100644 index d89819ea6..000000000 Binary files a/data/sounds/old/jump.wav and /dev/null differ diff --git a/data/sounds/old/ricochet.wav b/data/sounds/old/ricochet.wav deleted file mode 100644 index 016c7bf61..000000000 Binary files a/data/sounds/old/ricochet.wav and /dev/null differ diff --git a/data/sounds/old/shoot.wav b/data/sounds/old/shoot.wav deleted file mode 100644 index 48696ef62..000000000 Binary files a/data/sounds/old/shoot.wav and /dev/null differ diff --git a/data/sounds/old/skid.wav b/data/sounds/old/skid.wav deleted file mode 100644 index 3abd9c7eb..000000000 Binary files a/data/sounds/old/skid.wav and /dev/null differ diff --git a/data/sounds/old/squish.wav b/data/sounds/old/squish.wav deleted file mode 100644 index a3f86c2ac..000000000 Binary files a/data/sounds/old/squish.wav and /dev/null differ diff --git a/data/sounds/old/upgrade.wav b/data/sounds/old/upgrade.wav deleted file mode 100644 index 95edf4735..000000000 Binary files a/data/sounds/old/upgrade.wav and /dev/null differ diff --git a/src/gameloop.c b/src/gameloop.c index 11be5ade3..bba8c2f37 100644 --- a/src/gameloop.c +++ b/src/gameloop.c @@ -7,7 +7,7 @@ bill@newbreedsoftware.com http://www.newbreedsoftware.com/supertux/ - April 11, 2000 - July 15, 2002 + April 11, 2000 - December 9, 2003 */ #include @@ -76,30 +76,15 @@ char * soundfilenames[NUM_SOUNDS] = { }; -/* Level names: */ - -char * levelnames[] = { - "Antarctica", - "Australia", - "India", - "Egypt", - "Greece", - "Spain", - "Brazil", - "America", - "Redmond" -}; - - /* Local variables: */ -int score, distros, level, lives, scroll_x, +int score, distros, level, lives, scroll_x, next_level, tux_dir, tux_size, tux_duck, tux_x, tux_xm, tux_y, tux_ym, tux_dying, tux_safe, jumping, jump_counter, frame, score_multiplier, tux_frame_main, tux_frame, tux_got_coffee, tux_skidding, - super_bkgd_time, time_left, tux_invincible_time, + super_bkgd_time, time_left, tux_invincible_time, endpos, counting_distros, distro_counter; -int bkgd_red, bkgd_green, bkgd_blue; +int bkgd_red, bkgd_green, bkgd_blue, level_width; int left, right, up, down, fire, old_fire; SDL_Surface * img_brick[2], * img_solid[4], * img_distro[4], * img_waves[3], * img_water, * img_pole, * img_poletop, * img_flag[2]; @@ -126,7 +111,7 @@ SDL_Surface * tux_right[3], * tux_left[3], Mix_Chunk * sounds[NUM_SOUNDS]; Mix_Music * song; #endif -unsigned char tiles[15][LEVEL_WIDTH + 5]; +unsigned char * tiles[15]; bouncy_distro_type bouncy_distros[NUM_BOUNCY_DISTROS]; broken_brick_type broken_bricks[NUM_BROKEN_BRICKS]; bouncy_brick_type bouncy_bricks[NUM_BOUNCY_BRICKS]; @@ -134,6 +119,8 @@ bad_guy_type bad_guys[NUM_BAD_GUYS]; floating_score_type floating_scores[NUM_FLOATING_SCORES]; upgrade_type upgrades[NUM_UPGRADES]; bullet_type bullets[NUM_BULLETS]; +char song_title[20]; +char levelname[20]; /* Local function prototypes: */ @@ -331,7 +318,7 @@ int gameloop(void) /* Handle key and joystick state: */ - if (!tux_dying) + if (!tux_dying && !next_level) { if (right == DOWN && left == UP) { @@ -441,6 +428,16 @@ int gameloop(void) } } } + + + /* End of level? */ + + if (tux_x >= endpos && endpos != 0) + { + /* FIXME: No need to kill Tux to end the level! ;^) */ + next_level = 1; + tux_dying = 1; + } /* Jump/jumping? */ @@ -518,9 +515,11 @@ int gameloop(void) else tux_duck = NO; } - } /* !tux_dying */ + } /* !tux_dying && !next_level */ else { + /* Tux either died, or reached the end of a level! */ + tux_ym = tux_ym + GRAVITY; if (tux_y >= 480) @@ -532,13 +531,64 @@ int gameloop(void) Mix_HaltMusic(); } #endif + + if (next_level) + { + /* End of a level! */ + + level++; + next_level = 0; + } + else + { + /* He died :^( */ + + lives--; + } + + + /* No more lives!? */ + + if (lives <= 0) + { + + + /* Display end-of-level stuff */ + /* (FIXME: This should go in its own event loop function!) */ + + clearscreen(0, 0, 0); + + drawcenteredtext("GAMEOVER", 200, letters_red, NO_UPDATE); + + sprintf(str, "SCORE: %d", score); + drawcenteredtext(str, 224, letters_gold, NO_UPDATE); + + sprintf(str, "DISTROS: %d", distros); + drawcenteredtext(str, 256, letters_blue, NO_UPDATE); + + SDL_Flip(screen); + SDL_Delay(5000); + + + /* FIXME: Should return to title screen, not restart game... */ + + level = 0; + lives = 3; + + score=0; + distros=0; + } + + + /* Either way, (re-)load the (next) level... */ - lives--; loadlevel(); + + unloadlevelgfx(); + loadlevelgfx(); } } - - + /* Move tux: */ tux_x = tux_x + tux_xm; @@ -549,15 +599,15 @@ int gameloop(void) if (tux_x < 0) tux_x = 0; - else if (tux_x > 320 && scroll_x < ((LEVEL_WIDTH * 32) - 640)) + else if (tux_x > 320 && scroll_x < ((level_width * 32) - 640)) { /* Scroll the screen in past center: */ scroll_x = scroll_x + (tux_x - 320); tux_x = 320; - if (scroll_x > ((LEVEL_WIDTH * 32) - 640)) - scroll_x = ((LEVEL_WIDTH * 32) - 640); + if (scroll_x > ((level_width * 32) - 640)) + scroll_x = ((level_width * 32) - 640); } else if (tux_x > 608) { @@ -834,6 +884,17 @@ int gameloop(void) trygrabdistro(tux_x + 31, tux_y - 32, scroll_x, NO_BOUNCE); } } + + + /* Enough distros for a One-up? */ + + if (distros >= DISTROS_LIFEUP) + { + /* FIXME: Play a special sound or flash or both! */ + + distros = distros - DISTROS_LIFEUP; + lives++; + } /* Keep in-bounds, vertically: */ @@ -1016,9 +1077,28 @@ int gameloop(void) bullets[i].y >= bad_guys[j].y - 4 && bullets[i].y <= bad_guys[j].y + 32 + 4) { + /* Kill the bad guy! */ + bullets[i].alive = 0; bad_guys[j].dying = FALLING; bad_guys[j].ym = -8; + + + /* Gain some points: */ + + if (bad_guys[j].kind == BAD_BSOD) + { + add_score(bad_guys[j].x - scroll_x, bad_guys[j].y, + 50 * score_multiplier); + } + else if (bad_guys[j].kind == BAD_LAPTOP) + { + add_score(bad_guys[j].x - scroll_x, bad_guys[j].y, + 25 * score_multiplier); + } + + + /* Play death sound: */ #ifndef NOSOUND playsound(sounds[SND_FALL]); #endif @@ -2136,7 +2216,7 @@ int gameloop(void) void initgame(void) { - level = 0; + level = 1; score = 0; distros = 0; lives = 3; @@ -2151,7 +2231,7 @@ void loadlevel(void) FILE * fi; char * filename; char str[80]; - char line[LEVEL_WIDTH + 5]; + char * line; /* Reset arrays: */ @@ -2179,8 +2259,9 @@ void loadlevel(void) /* Load data file: */ - - filename = strdup(DATA_PREFIX "/levels/level1.dat"); + + filename = (char *) malloc(sizeof(char) * (strlen(DATA_PREFIX) + 20)); + sprintf(filename, "%s/levels/level%d.dat", DATA_PREFIX, level); fi = fopen(filename, "r"); if (fi == NULL) { @@ -2189,18 +2270,51 @@ void loadlevel(void) } free(filename); - fgets(line, 10, fi); - bkgd_red = atoi(line); - fgets(line, 10, fi); - bkgd_green= atoi(line); - fgets(line, 10, fi); - bkgd_blue = atoi(line); + + /* Load header info: */ + + /* (Level title) */ + fgets(str, 20, fi); + strcpy(levelname, str); + + /* (Time to beat level) */ + fgets(str, 10, fi); + time_left = atoi(str); + + /* (Song file for this level) */ + fgets(str, 20, fi); + strcpy(song_title, str); + + /* (Level background color) */ + fgets(str, 10, fi); + bkgd_red = atoi(str); + fgets(str, 10, fi); + bkgd_green= atoi(str); + fgets(str, 10, fi); + bkgd_blue = atoi(str); + + /* (Level width) */ + fgets(str, 10, fi); + level_width = atoi(str); + + + /* Allocate some space for the line-reading! */ + + line = (char *) malloc(sizeof(char) * (level_width + 5)); + if (line == NULL) + { + fprintf(stderr, "Couldn't allocate space to load level data!"); + exit(1); + } + + + /* Load the level lines: */ for (y = 0; y < 15; y++) { - fgets(line, LEVEL_WIDTH + 5, fi); + fgets(line, level_width + 5, fi); line[strlen(line) - 1] = '\0'; - strcpy(tiles[y], line); + tiles[y] = strdup(line); } fclose(fi); @@ -2210,7 +2324,7 @@ void loadlevel(void) for (y = 0; y < 15; y++) { - for (x = 0; x < LEVEL_WIDTH; x++) + for (x = 0; x < level_width; x++) { if (tiles[y][x] >= '0' && tiles[y][x] <= '9') { @@ -2266,7 +2380,7 @@ void loadlevel(void) sprintf(str, "LEVEL %d", level + 1); drawcenteredtext(str, 200, letters_red, NO_UPDATE); - sprintf(str, "%s", levelnames[level]); + sprintf(str, "%s", levelname); drawcenteredtext(str, 224, letters_gold, NO_UPDATE); sprintf(str, "TUX x %d", lives); @@ -2320,8 +2434,17 @@ void loadlevelgfx(void) void loadlevelsong(void) { + char * song_path; + #ifndef NOSOUND + song_path = (char *) malloc(sizeof(char) * (strlen(DATA_PREFIX) + + strlen(song_title) + 8)); + + sprintf(song_path, "%s/music/%s", DATA_PREFIX, song_title); + song = load_song(DATA_PREFIX "/music/ji_turn.it"); + + free(song_path); #endif } @@ -2840,7 +2963,13 @@ void drawshape(int x, int y, unsigned char c) else if (c == '*') drawimage(img_poletop, x, y, NO_UPDATE); else if (c == '|') + { drawimage(img_pole, x, y, NO_UPDATE); + + /* Mark this as the end position of the level! */ + + endpos = x; + } else if (c == '\\') { z = (frame / 3) % 2; @@ -2862,7 +2991,7 @@ unsigned char shape(int x, int y, int sx) yy = (y / 32); xx = ((x + sx) / 32); - if (yy >= 0 && yy <= 15 && xx >= 0 && xx <= LEVEL_WIDTH) + if (yy >= 0 && yy <= 15 && xx >= 0 && xx <= level_width) c = tiles[yy][xx]; else c = '.'; @@ -2970,7 +3099,7 @@ void change(int x, int y, int sx, unsigned char c) yy = (y / 32); xx = ((x + sx) / 32); - if (yy >= 0 && yy <= 15 && xx >= 0 && xx <= LEVEL_WIDTH) + if (yy >= 0 && yy <= 15 && xx >= 0 && xx <= level_width) tiles[yy][xx] = c; } diff --git a/src/gameloop.h b/src/gameloop.h index 813a07710..acde44267 100644 --- a/src/gameloop.h +++ b/src/gameloop.h @@ -35,6 +35,11 @@ #define BOUNCE 1 +/* One-ups... */ + +#define DISTROS_LIFEUP 100 + + /* Dying types: */ /* ---- NO 0 */