[Super-tux-commit] supertux/src special.cpp,1.44,1.45
Brought to you by:
wkendrick
From: Ryan F. <sik...@us...> - 2004-05-14 08:36:23
|
Update of /cvsroot/super-tux/supertux/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv4415 Modified Files: special.cpp Log Message: - fixed [sorta] the mushroom bumping problems - is it okay to determine the direction from the player's position? Index: special.cpp =================================================================== RCS file: /cvsroot/super-tux/supertux/src/special.cpp,v retrieving revision 1.44 retrieving revision 1.45 diff -u -d -r1.44 -r1.45 --- special.cpp 12 May 2004 18:28:37 -0000 1.44 +++ special.cpp 14 May 2004 08:36:13 -0000 1.45 @@ -309,7 +309,7 @@ } void -Upgrade::bump(Player* ) +Upgrade::bump(Player* player) { // these can't be bumped if(kind != UPGRADE_GROWUP) @@ -317,9 +317,14 @@ play_sound(sounds[SND_BUMP_UPGRADE], SOUND_CENTER_SPEAKER); + // determine new direction + if (player->base.x + player->base.width/2 > base.x + base.width/2) + dir = LEFT; + else + dir = RIGHT; + // do a little jump and change direction physic.set_velocity(-physic.get_velocity_x(), 3); - dir = dir == LEFT ? RIGHT : LEFT; physic.enable_gravity(true); } |