[Super-tux-commit] supertux/src badguy.cpp,1.20,1.21 badguy.h,1.20,1.21 title.cpp,1.19,1.20
Brought to you by:
wkendrick
From: Ingo R. <gr...@us...> - 2004-04-10 11:56:19
|
Update of /cvsroot/super-tux/supertux/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv21143/src Modified Files: badguy.cpp badguy.h title.cpp Log Message: - introduced mriceblock (at least a bit) - made title screen wrap-around seamlessly Index: badguy.h =================================================================== RCS file: /cvsroot/super-tux/supertux/src/badguy.h,v retrieving revision 1.20 retrieving revision 1.21 diff -u -d -r1.20 -r1.21 --- badguy.h 4 Apr 2004 00:32:10 -0000 1.20 +++ badguy.h 10 Apr 2004 11:42:43 -0000 1.21 @@ -23,7 +23,7 @@ extern texture_type img_bsod_left[4]; extern texture_type img_bsod_right[4]; -extern texture_type img_laptop_left[3]; +extern texture_type img_laptop_left[4]; extern texture_type img_money_left[2]; /* Enemy modes: */ Index: badguy.cpp =================================================================== RCS file: /cvsroot/super-tux/supertux/src/badguy.cpp,v retrieving revision 1.20 retrieving revision 1.21 diff -u -d -r1.20 -r1.21 --- badguy.cpp 9 Apr 2004 16:25:17 -0000 1.20 +++ badguy.cpp 10 Apr 2004 11:42:43 -0000 1.21 @@ -28,8 +28,8 @@ texture_type img_laptop_falling_right[1]; texture_type img_bsod_left[4]; texture_type img_bsod_right[4]; -texture_type img_laptop_left[3]; -texture_type img_laptop_right[3]; +texture_type img_laptop_left[4]; +texture_type img_laptop_right[4]; texture_type img_money_left[2]; texture_type img_money_right[2]; texture_type img_mrbomb_left[4]; @@ -57,7 +57,7 @@ { if (str == "money") return BAD_MONEY; - else if (str == "laptop") + else if (str == "laptop" || str == "mriceblock") return BAD_LAPTOP; else if (str == "bsod") return BAD_BSOD; @@ -157,7 +157,7 @@ set_texture(img_mrbomb_left, img_mrbomb_right, 4); } else if (kind == BAD_LAPTOP) { physic.set_velocity(-1.3, 0); - set_texture(img_laptop_left, img_laptop_right, 3); + set_texture(img_laptop_left, img_laptop_right, 4, 5); } else if(kind == BAD_MONEY) { set_texture(img_money_left, img_money_right, 1); } else if(kind == BAD_BOMB) { @@ -296,7 +296,7 @@ if(!timer_check(&timer)) { mode = NORMAL; - set_texture(img_laptop_left, img_laptop_right, 3); + set_texture(img_laptop_left, img_laptop_right, 4, 5); physic.set_velocity( (dir == LEFT) ? -1.3 : 1.3, 0); } } @@ -986,32 +986,18 @@ /* (Laptop) */ - texture_load(&img_laptop_left[0], datadir + - "/images/shared/laptop-left-0.png", - USE_ALPHA); - - texture_load(&img_laptop_left[1], datadir + - "/images/shared/laptop-left-1.png", - USE_ALPHA); - - texture_load(&img_laptop_left[2], datadir + - "/images/shared/laptop-left-2.png", - USE_ALPHA); - - texture_load(&img_laptop_right[0], datadir + - "/images/shared/laptop-right-0.png", - USE_ALPHA); - - texture_load(&img_laptop_right[1], datadir + - "/images/shared/laptop-right-1.png", - USE_ALPHA); - - texture_load(&img_laptop_right[2], datadir + - "/images/shared/laptop-right-2.png", - USE_ALPHA); + texture_load(&img_laptop_left[0], datadir + "/images/shared/mriceblock-left-0.png", USE_ALPHA); + texture_load(&img_laptop_left[1], datadir + "/images/shared/mriceblock-left-1.png", USE_ALPHA); + texture_load(&img_laptop_left[2], datadir + "/images/shared/mriceblock-left-2.png", USE_ALPHA); + texture_load(&img_laptop_left[3], datadir + "/images/shared/mriceblock-left-1.png", USE_ALPHA); - texture_load(&img_laptop_flat_left[0], datadir + - "/images/shared/laptop-flat-left.png", + texture_load(&img_laptop_right[0], datadir + "/images/shared/mriceblock-right-0.png", USE_ALPHA); + texture_load(&img_laptop_right[1], datadir + "/images/shared/mriceblock-right-1.png", USE_ALPHA); + texture_load(&img_laptop_right[2], datadir + "/images/shared/mriceblock-right-2.png", USE_ALPHA); + texture_load(&img_laptop_right[3], datadir + "/images/shared/mriceblock-right-1.png", USE_ALPHA); + + texture_load(&img_laptop_flat_left[0], + datadir + "/images/shared/laptop-flat-left.png", USE_ALPHA); texture_load(&img_laptop_flat_right[0], datadir + @@ -1144,7 +1130,7 @@ texture_free(&img_bsod_falling_left[0]); texture_free(&img_bsod_falling_right[0]); - for (int i = 0; i < 3; i++) + for (int i = 0; i < 4; i++) { texture_free(&img_laptop_left[i]); texture_free(&img_laptop_right[i]); Index: title.cpp =================================================================== RCS file: /cvsroot/super-tux/supertux/src/title.cpp,v retrieving revision 1.19 retrieving revision 1.20 diff -u -d -r1.19 -r1.20 --- title.cpp 9 Apr 2004 01:15:31 -0000 1.19 +++ title.cpp 10 Apr 2004 11:42:43 -0000 1.20 @@ -107,14 +107,22 @@ timer_start(&random_timer, rand() % 3000 + 3000); walking = !walking; } - + + // Wrap around at the end of the level back to the beginnig if(current_level.width * 32 - 320 < titletux.base.x) { - titletux.base.x = 160; - scroll_x = 0; + titletux.base.x = titletux.base.x - (current_level.width * 32 - 640); + scroll_x = titletux.base.x - 320; } + float last_tux_x_pos = titletux.base.x; titletux.action(); + + // Jump if tux stays in the same position for one loop, ie. if he is + // stuck behind a wall + if (last_tux_x_pos == titletux.base.x) + walking = false; + titletux.draw(); /* DEMO end */ |