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 381153
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 12, 20262026-05-12T15:03:29+00:00 2026-05-12T15:03:29+00:00

I think the title is rather self explanatory but just to clarify I am

  • 0

I think the title is rather self explanatory but just to clarify I am trying to figure out how to tell which side the collision has occured on.

For a bit more detail, I’m trying to make a maze-like game so I can’t simply stop all movement upon a collision. Instead I need to be able to tell which side the collision has happened on so I can block that direction.

Any help is appreciated and if there is a better approach to this issue, I’m all for trying it out.

I hope this is enough details but if you need anymore, ask and I’ll edit. Thanks in advance.

[edit]
@viggity – No, I’m not using any specific game engine and I would post the current “detection” code but it’s a little, absurdly, robust.

@Streklin – I’m using the this.Paint event to draw onto the form itself as it was recommended I start by doing that to get better at drawing real time. I’m also using a location that’s updated each time the timer ticks based on what I press (left, right, up, down). Yes the maze is tile based. Currently it only consists of 3 colors even. I’m not a very advanced programmer.

@Eric – Definately a one-d game. Again, I only have 3 colors, the lines are black, the background is white and the square (the user) is green. I’m using the DrawImage() with Bitmaps to draw onto the screen.

[edit psuedo-code summary]

foreach(Wall _wall in walls)
if(player.intersectsWith(_wall))
stop movement;

@JeffH – I’m not really sure what you’re asking as that’s pretty much all there is besides testing code that I was using to try and get it working. The only thing I left out was the if statement to check if it was the x axis or not so that x and y could move indepedently from each other. So instead of getting “stuck” because you touched the wall, you could slide against it. I didn’t see the point in including that though since the problem occurs before that.

  • 1 1 Answer
  • 1 View
  • 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-05-12T15:03:29+00:00Added an answer on May 12, 2026 at 3:03 pm

    Assuming you’re talking about a 3D game here.

    The normal of the face you can see points towards you, so the dot product of your direction vector with the face normal will be negative. If it’s positive then you are coming at the face from the back.

    If it’s zero you’re travelling at right angles to the face.

    |              <---------- your direction of travel
    |
    |----------> <- face normal
    |
    | <- face
    

    If you’re not in 3D then you could store the direction the wall is facing (as a 2D vector) and do the same dot product with your 2D direction of movement.

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

Sidebar

Related Questions

I think the title is fairly self explanatory, but to give a little context.
I think the title is self explanatory. What I'm looking for is material so
OK, I don't think the title says it right... but here goes: I have
i think my whole questions is inside title bar =] but i'll explain little
Sorry for the rather vague title, but it seemed befitting of a similarly vague
I think this should be a rather simple thing to do, but I'm completely
Can't figure out what's wrong. When I click on a model title, it fetches
I can't think of a good title, but my question is not as naive
Sorry for the rather vague title, I couldn't think up a better description for
Sorry about the title but I can't really think of a quick way of

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.