[Super-tux-commit] supertux/src badguy.cpp,1.51,1.52 gameloop.cpp,1.110,1.111 player.cpp,1.68,1.69
Brought to you by:
wkendrick
From: Ingo R. <gr...@us...> - 2004-04-26 19:58:20
|
Update of /cvsroot/super-tux/supertux/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv30830 Modified Files: badguy.cpp gameloop.cpp player.cpp Log Message: - 'nother badguy fix from MatzeB: <MatzeB> -fixes the bumping problem for badguys <MatzeB> -implements bill kendricks proposal about helding iceblock (if you hit another enemy while Index: player.cpp =================================================================== RCS file: /cvsroot/super-tux/supertux/src/player.cpp,v retrieving revision 1.68 retrieving revision 1.69 diff -u -d -r1.68 -r1.69 --- player.cpp 26 Apr 2004 14:40:17 -0000 1.68 +++ player.cpp 26 Apr 2004 19:58:11 -0000 1.69 @@ -596,7 +596,8 @@ !safe_timer.started() && pbad_c->mode != BadGuy::HELD) { - if (pbad_c->mode == BadGuy::FLAT && input.fire == DOWN) + if (pbad_c->mode == BadGuy::FLAT && input.fire == DOWN + && !holding_something) { holding_something = true; pbad_c->mode = BadGuy::HELD; Index: badguy.cpp =================================================================== RCS file: /cvsroot/super-tux/supertux/src/badguy.cpp,v retrieving revision 1.51 retrieving revision 1.52 diff -u -d -r1.51 -r1.52 --- badguy.cpp 26 Apr 2004 14:40:17 -0000 1.51 +++ badguy.cpp 26 Apr 2004 19:58:11 -0000 1.52 @@ -827,10 +827,11 @@ void BadGuy::bump() { - if(kind == BAD_BSOD || kind == BAD_LAPTOP || kind == BAD_MRBOMB - || kind == BAD_BOUNCINGSNOWBALL) { - kill_me(); - } + // these can't be bumped + if(kind == BAD_FLAME || kind == BAD_BOMB || kind == BAD_FISH) + return; + + kill_me(); } void @@ -941,10 +942,16 @@ return; dying = DYING_FALLING; - if(kind == BAD_LAPTOP) + if(kind == BAD_LAPTOP) { set_sprite(img_laptop_falling_left, img_laptop_falling_right); - else if(kind == BAD_BSOD) + if(mode == HELD) { + mode = NORMAL; + Player& tux = *World::current()->get_tux(); + tux.holding_something = false; + } + } else if(kind == BAD_BSOD) { set_sprite(img_bsod_falling_left, img_bsod_falling_right); + } physic.enable_gravity(true); physic.set_velocity_y(0); @@ -988,12 +995,18 @@ pbad_c = (BadGuy*) p_c_object; /* If we're a kicked mriceblock, kill any badguys we hit */ - if(kind == BAD_LAPTOP && mode == KICK && - pbad_c->kind != BAD_FLAME && pbad_c->kind != BAD_BOMB) + if(kind == BAD_LAPTOP && mode == KICK) { pbad_c->kill_me(); } + // a held mriceblock gets kills the enemy too but falls to ground then + else if(kind == BAD_LAPTOP && mode == HELD) + { + pbad_c->kill_me(); + kill_me(); + } + /* Kill badguys that run into exploding bomb */ else if (kind == BAD_BOMB && dying == DYING_NOT) { Index: gameloop.cpp =================================================================== RCS file: /cvsroot/super-tux/supertux/src/gameloop.cpp,v retrieving revision 1.110 retrieving revision 1.111 diff -u -d -r1.110 -r1.111 --- gameloop.cpp 26 Apr 2004 19:11:53 -0000 1.110 +++ gameloop.cpp 26 Apr 2004 19:58:11 -0000 1.111 @@ -415,7 +415,7 @@ /* End of level? */ int endpos = (World::current()->get_level()->width-10) * 32; Tile* endtile = collision_goal(tux->base); - printf("EndTile: %p.\n", endtile); + //printf("EndTile: %p.\n", endtile); // fallback in case the other endpositions don't trigger if (tux->base.x >= endpos || (endtile && endtile->data >= 1) || (end_sequence && !endsequence_timer.check())) |