XNA Creators Club Online
Page 1 of 1 (2 items)
Sort Posts: Previous Next

Multi sprites Collision issue

Last post 3/17/2009 4:39 PM by Demonofloom. 1 replies.
  • 3/16/2009 5:12 PM

    Multi sprites Collision issue

    Hi guys first of thanks for reading this.

    I want to load 10 sprites on the screen in diffrent potions with out them over lapping each other

    I am using random() and also I am loading there vector2 postions into an array then loading them using a for loop

    how can I check the array to make sure that none of my Rectangles collide?

    thanks again.
  • 3/17/2009 4:39 PM In reply to

    Re: Multi sprites Collision issue

    Well the most common ways of collision detection are Bouncing Box and Radial Collision.

    Radial Collision works by imagining there is a sphere around the object, defined by the objects center position and its radius. Then you do some simple checks like:

    distance = pos1 - pos2; // Different in Positions
    If Distance < obj1.radius + obj2.radius //Checks if the distance is less than the two radius together, if so then they are probably colliding.


    The above isn't proper code btw.

    http://lemoncog.co.uk
Page 1 of 1 (2 items) Previous Next