Im attempting to make asteroids bounce off eachother on collision. I have setup rectangles and tried to do this code:
1 2 3 4 5
Rectangle asteroidRectangle = new Rectangle((int)asteroids.Position.X, (int)asteroids.Position.Y, Asteroid.Texture.Width, Asteroid.Texture.Height);
if (asteroidRectangle.Intersects(asteroidRectangle))
{
// Not sure what to enter here
}
The asteroid itself has a class which declares position, velocity, texture ect.