Scrolling Game Development Kit Forum

SGDK Version 2 => Help, Errors, FAQ => Topic started by: tylercomp on 2012-10-07, 11:01:39 PM

Title: sprite collision
Post by: tylercomp on 2012-10-07, 11:01:39 PM
Hello,

How do I set up rules around two sprite colliding?

For example when player1 sprite touches enemy1 sprite then I want to send player1 somewhere.

Thanks!
Title: Re: sprite collision
Post by: bluemonkmn on 2012-10-08, 01:33:54 PM
TestCollisionRect will output a numeric value indicating which sprite in a collection this sprite is touching, if any. If it returns -1 that means this sprite it not touching any sprite in the specified target category.