Im developing smaall Windows Game using Xna game studio..
My question is i got two objects like Ship and The Land Tile... Imagine that ship has rectangle call shiprectangle and land has rectangle called landrectangle.. rectangle represents the current position of the object..
The land tiles are loded in random places in map.. i just want to know if ship is collied in land tile and ship have to ignore the land and go to another derection..
Simply the meaning is i dont want to see ship is going on lands... Thats the idea...
private void HandleLandCollition()
{
foreach (LandTile landtile in landtiles)
{
if (ship.rectangle.Intersects(landtile.rectangle))
{
//Code Here
}
}
}

