[Super-tux-commit] supertux/src gameloop.cpp,1.37,1.38 gameloop.h,1.20,1.21 player.cpp,1.16,1.17 til
Brought to you by:
wkendrick
From: Ingo R. <gr...@us...> - 2004-03-28 14:23:12
|
Update of /cvsroot/super-tux/supertux/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv21013 Modified Files: gameloop.cpp gameloop.h player.cpp tile.cpp tile.h Log Message: - removed alpha from tile since it isn't needed - fixed brick behaviour (I hope...) Index: tile.h =================================================================== RCS file: /cvsroot/super-tux/supertux/src/tile.h,v retrieving revision 1.5 retrieving revision 1.6 diff -u -d -r1.5 -r1.6 --- tile.h 28 Mar 2004 12:41:11 -0000 1.5 +++ tile.h 28 Mar 2004 14:11:53 -0000 1.6 @@ -51,7 +51,6 @@ int next_tile; int anim_speed; - unsigned char alpha; }; Index: player.cpp =================================================================== RCS file: /cvsroot/super-tux/supertux/src/player.cpp,v retrieving revision 1.16 retrieving revision 1.17 diff -u -d -r1.16 -r1.17 --- player.cpp 26 Mar 2004 23:53:31 -0000 1.16 +++ player.cpp 28 Mar 2004 14:11:53 -0000 1.17 @@ -216,8 +216,7 @@ trygrabdistro(base.x, base.y - 32,BOUNCE); trybumpbadguy(base.x, base.y - 64); - if(size == BIG) - trybreakbrick(base.x, base.y); + trybreakbrick(base.x, base.y, size == SMALL); bumpbrick(base.x, base.y); tryemptybox(base.x, base.y, RIGHT); @@ -230,59 +229,11 @@ trybumpbadguy(base.x+ 31, base.y - 64); if(size == BIG) - trybreakbrick(base.x+ 31, base.y); + trybreakbrick(base.x+ 31, base.y, size == SMALL); bumpbrick(base.x+ 31, base.y); tryemptybox(base.x+ 31, base.y, LEFT); } - - - if(size == SMALL) - { - Tile* tile = gettile(base.x, base.y); - /* Get a distro from a brick? */ - if (tile->brick) - { - add_bouncy_distro((((int)base.x) - / 32) * 32, - ((int)base.y / 32) * 32); - - if (counting_distros == false) - { - counting_distros = true; - distro_counter = 100; - } - - if (distro_counter <= 0) - level_change(¤t_level,base.x,base.y - 1, TM_IA, tile->next_tile); - - play_sound(sounds[SND_DISTRO], SOUND_CENTER_SPEAKER); - score = score + SCORE_DISTRO; - distros++; - } - } - else - { - Tile* tile2 = gettile(base.x + 31, base.y); - if (tile2->brick) - { - add_bouncy_distro((((int)base.x + 31) - / 32) * 32, - ((int)base.y / 32) * 32); - if (counting_distros == false) - { - counting_distros = true; - distro_counter = 100; - } - - if (distro_counter <= 0) - level_change(¤t_level,base.x+ 31, base.y, TM_IA, tile2->next_tile); - - play_sound(sounds[SND_DISTRO], SOUND_CENTER_SPEAKER); - score = score + SCORE_DISTRO; - distros++; - } - } } grabdistros(); Index: gameloop.h =================================================================== RCS file: /cvsroot/super-tux/supertux/src/gameloop.h,v retrieving revision 1.20 retrieving revision 1.21 diff -u -d -r1.20 -r1.21 --- gameloop.h 25 Mar 2004 02:27:45 -0000 1.20 +++ gameloop.h 28 Mar 2004 14:11:53 -0000 1.21 @@ -43,9 +43,18 @@ void drawshape(float x, float y, unsigned int c); unsigned int shape(float x, float y); void bumpbrick(float x, float y); + +/** Try to grab the coin at the given coordinates */ void trygrabdistro(float x, float y, int bounciness); -void trybreakbrick(float x, float y); + +/** Try to break the brick at the given coordinates */ +void trybreakbrick(float x, float y, bool small); + +/** Try to get the content out of a bonus box, thus emptying it */ void tryemptybox(float x, float y, int col_side); + +/** Try to bumb a badguy that might we walking above Tux, thus shaking + the tile which the badguy is walking on an killing him this way */ void trybumpbadguy(float x, float y); #endif /*SUPERTUX_GAMELOOP_H*/ Index: tile.cpp =================================================================== RCS file: /cvsroot/super-tux/supertux/src/tile.cpp,v retrieving revision 1.6 retrieving revision 1.7 diff -u -d -r1.6 -r1.7 --- tile.cpp 28 Mar 2004 12:41:11 -0000 1.6 +++ tile.cpp 28 Mar 2004 14:11:53 -0000 1.7 @@ -46,7 +46,6 @@ tile->fullbox = false; tile->distro = false; tile->data = 0; - tile->alpha = 0; tile->next_tile = 0; tile->anim_speed = 25; @@ -57,8 +56,7 @@ reader.read_bool("ice", &tile->ice); reader.read_bool("fullbox", &tile->fullbox); reader.read_bool("distro", &tile->distro); - reader.read_int("data", (int*)&tile->data); - reader.read_int("alpha", (int*)&tile->alpha); + reader.read_int("data", &tile->data); reader.read_int("anim-speed", &tile->anim_speed); reader.read_int("next-tile", &tile->next_tile); reader.read_string_vector("images", &tile->filenames); Index: gameloop.cpp =================================================================== RCS file: /cvsroot/super-tux/supertux/src/gameloop.cpp,v retrieving revision 1.37 retrieving revision 1.38 diff -u -d -r1.37 -r1.38 --- gameloop.cpp 28 Mar 2004 12:41:11 -0000 1.37 +++ gameloop.cpp 28 Mar 2004 14:11:53 -0000 1.38 @@ -1344,8 +1344,7 @@ } /* Break a brick: */ - -void trybreakbrick(float x, float y) +void trybreakbrick(float x, float y, bool small) { Tile* tile = gettile(x, y); if (tile->brick) @@ -1369,23 +1368,19 @@ score = score + SCORE_DISTRO; distros++; } - else + else if (!small) { /* Get rid of it: */ level_change(¤t_level,x, y, TM_IA, tile->next_tile); + + /* Replace it with broken bits: */ + add_broken_brick(((int)(x + 1) / 32) * 32, + (int)(y / 32) * 32); + + /* Get some score: */ + play_sound(sounds[SND_BRICK], SOUND_CENTER_SPEAKER); + score = score + SCORE_BRICK; } - - - /* Replace it with broken bits: */ - - add_broken_brick(((int)(x + 1) / 32) * 32, - (int)(y / 32) * 32); - - - /* Get some score: */ - - play_sound(sounds[SND_BRICK], SOUND_CENTER_SPEAKER); - score = score + SCORE_BRICK; } } |