Re: [Super-tux-commit] supertux/src special.cpp,1.44,1.45
Brought to you by:
wkendrick
From: Ricardo C. <ri...@ae...> - 2004-05-14 13:59:30
|
Obviously, the direction should taken the player's position in consideration. Ricardo Em Sexta, 14 de Maio de 2004 09:36, o Ryan Flegel escreveu: > 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); > } > > > > > ------------------------------------------------------- > This SF.Net email is sponsored by: SourceForge.net Broadband > Sign-up now for SourceForge Broadband and get the fastest > 6.0/768 connection for only $19.95/mo for the first 3 months! > http://ads.osdn.com/?ad_id=2562&alloc_id=6184&op=click > _______________________________________________ > Super-tux-commit mailing list > Sup...@li... > https://lists.sourceforge.net/lists/listinfo/super-tux-commit -- "Calling J-Man Kink. Calling J-Man Kink. Hash missile sighted, target Los Angeles. Disregard personal feelings about city and intercept." -- The Firesign Theatre movie, _J-Men Forever_ |