Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8719649
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T06:50:57+00:00 2026-06-13T06:50:57+00:00

Im developing smaall Windows Game using Xna game studio.. My question is i got

  • 0

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
}
}
}

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-13T06:50:59+00:00Added an answer on June 13, 2026 at 6:50 am

    A basic version could be like this:

    Via the Rectangle.Intersect – Method you get the rectangle where both of the rectangles intersect.

    A picture of two intersecting rectangles.

    Now you can move the ship away from the landtile using the values from the intersection-rectangle.

    A picture of two intersecting rectangles. With arrows showing how to move one rectangle out of the other one.

    In the shown case you just can subtract the Width and Height – values from the X and Y values of the Ship, to move the ship away from the landtile.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm developing a small windows app using c++ and i would like to get
I'm about to start developing a small Windows application using Microsoft Visual C# 2008
I'm developing a small ATL DLL file in Windows/Visual Studio IDE, and I'm relatively
I am developing my first windows mobile application and would like some guidance on
I'm Developing a small windows application in C#.net in Visual Studio 2010 with framework
I'm using Windows XP and currently, I'm developing a small win form application so
I want to create a Tree view using vector in Android.It will like windows
I am currently developing a small simulation utility, using the Task Parallel Library to
I'm developing a small application using Blend, basically what I have in my application
I'm currently developing a small OpenGL game for the Android platform and I wonder

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.