Stratos: Punto de Encuentro de Desarrolladores

¡Bienvenido a Stratos!

Acceder

Foros





Sprite Demo Details...

Iniciado por babaum, 30 de Marzo de 2006, 09:05:38 PM

« anterior - próximo »

babaum

 Sorry if I'm being too rookie on this, but could somebody explain me one thing that happens in the sprite demo?
When the sprites collide, the borders become red. I don't understand were is that effect coming from...

Thanx!
(ole)  

TheAzazel

 Dont worry, I can explain you. If you look the SpriteCollision.cpp code, you can see this line:
isCollision=sprRabbit->Collision(surfCursor,&rCursor,-1,-1,1);

and in documentation you can find this about Collision member:

Citarint CRM32Pro_CSprite::Collision  (CRM32Pro_CSprite *     spr,
  Sint16     spr_x = -1,
  Sint16     spr_y = -1,
  Sint16     this_x = -1,
  Sint16     this_y = -1,
  Uint8     debug = 0
   )     
     

Check collision with another sprite.

Parameters:
       spr  test sprite collision against this sprite
       spr_x  by default is -1 and it uses current screen X position of the sprite 'spr'. Other value, means only your absolute X position on your own system coordinates
       spr_y  by default is -1 and it uses current screen Y position of the sprite 'spr'. Other value, means only your absolute Y position on your own system coordinates
       this_x  by default is -1 and it uses current screen X position of this sprite. Other value, means only your absolute X position on your own system coordinates
       this_y  by default is -1 and it uses current screen Y position of this sprite. Other value, means only your absolute Y position on your own system coordinates
       debug  by default is 0 and it won´t to render any debug information. Otherwise, it will show bounding box and so on

So the blue box is debug information to see the real limits of the sprite and the red box is the bounding box or what it is the same, the area where pixel perfect collision will be performed.

Let me know if you have any other problem :)

cheers!






Stratos es un servicio gratuito, cuyos costes se cubren en parte con la publicidad.
Por favor, desactiva el bloqueador de anuncios en esta web para ayudar a que siga adelante.
Muchísimas gracias.