Re: [Super-tux-devel] Gameloop Rewrite Status
Brought to you by:
wkendrick
From: Tobias <tob...@gm...> - 2004-01-03 12:59:50
|
Am Sa, den 03.01.2004 schrieb Ingo Ruhnke um 07:50: > Ricardo Cruz <ri...@ae...> writes: > > > You could also have a look at one of the Ingo's games, like > > Windestille or Pingus (they are c++, but may be helpfull). > > Pingus uses just a single pixel (or sometimes two) for collision > detection. Windstille, even so it has some bitmask code, doesn't use > it at the moment and instead uses some quick collision-rectangle > hacks. So both aren't really good examples. > > Using multiple bitmaskes (one for the top, another one for the sides) > might work, calculating the entry-vector into the enemy might also > provide some informations, but I havn't really found out myself on how > to solve this problem cleanly. My aim is to calculate the angle in which object A got hit by object B, like described in the tutorial Ricardo showed us. And I don't want to use bitmap-collisions for all objects, but for Tux in example. :) The code handling already calculated collisions will look like this: void badguy_collision(bad_guy_type* pbad, int c_object, int angle) { /* Handle collision with Tux, but don't touch tux's internals, only touch the badguy's internals */ if(c_object == CO_TUX) { if(angle == 0) pbad->dying = FALLING; ... } } Greetz... Tobias Gläßer -- |