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

  • SEARCH
  • Home
  • 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 8979725
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T19:54:44+00:00 2026-06-15T19:54:44+00:00

So basically, I am doing my first xna game and it’s an arkanoid game.

  • 0

So basically, I am doing my first xna game and it’s an arkanoid game. My ball right now is a square that rotate.

Unfortunately, it’s impossible to correctly detect the collision of a rotated rectangle in xna.

I found thing about scalars but I am only in computer science in college so I don’t know about these big maths…

Can anyone direct me in the right way to detect these kind of collision ? or at least to be able to obtain a new rectangle in the right way so that I can detect the collision on this one?

EDIT
I just thought about making my rotating square in a still square and test the collision with the outer square would that be viable ?

  • 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-15T19:54:45+00:00Added an answer on June 15, 2026 at 7:54 pm

    If you want to detect a collision of the square ball with the outer rectangle, you need to know the coordinates of the four corners of the ball. Then simply compare these points with the outer rectangle.

    If s is the length of the sides of the rectangle. The corners can be calculated like this:

    double h = 0.707106781 * s; // Half diagonal
    double angle = rotation_angle + 0.25 * Math.PI; // 0.25 * Math.PI = 45 degrees
                                                    // inclination of the diagonal.
    double x = h * Math.Cos(angle);
    double y = h * Math.Sin(angle);
    
    // The four points are
    p1x = +x + squareCenterX;
    p1y = +y + squareCenterY;
    
    p2x = -y + squareCenterX;
    p2y = +x + squareCenterY;
    
    p3x = -x + squareCenterX;
    p3y = -y + squareCenterY;
    
    p4x = +y + squareCenterX;
    p4y = -x + squareCenterY;
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I've seen a bunch of posts that do basically what I'm doing, but unfortunately
I am basically doing a tutorial but my program seems to have errors that
let me first off noting that I have absolutely no idea what I'm doing
Let me explain what I am doing first before I get into everything basically
This is my first time doing these things. Basically I am creating a batch
I am basically doing a demo so don't ask why. It's very easy to
I'm setting up a C++ project, on Ubuntu x64, using Eclipse-CDT. I'm basically doing
I'm basically just doing some tests to figure out a good way to write
Why isn't my if-statement working? It doesn't accept NSCFStrings... Basically I'm doing this: if
Basically what I'm doing is checking for the existence of an object, if it's

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.