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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T13:19:56+00:00 2026-06-08T13:19:56+00:00

I have a moving mars lander which I want to detect when it hits

  • 0

I have a moving mars lander which I want to detect when it hits the top of a refuelling station in a game I’m making. I want to know the best way to know exactly when they hit.

What I am doing at the moment is I have 3 timers controlling horizontal, vertical and gravitational movement. Each timer makes the mars lander move a bit so I put the crash detection code at the top and bottom of each of these but since each one is fireing every 50 milliseconds a) it wont detect exactly when it collides and b) it will call the crash detection code a lot of times.

This is what one of the timers looks like and its pretty much the same for all 3 (I am making the game in vb 2008, this is just some pseudo-code):

gravity timer:
    detectCrash()
    Move ship 
    detectCrash()
End timer
  1. what would be a more accurate way to see if they are colliding in terms of response time from the collide to the code which that calls.

  2. how would I call the detection a lower amount of times?

I could possibly make another timer that fires every 10 milliseconds or so and check the collision but then this will run the code an awful lot of times (100 times a second) wont it?

I am also curious as to how large games would handle something like this which most likely happens many times a second.

Thanks.

  • 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-08T13:19:58+00:00Added an answer on June 8, 2026 at 1:19 pm

    You don’t want to have separate timers for moving the object and for detecting collisions. This approach has a couple of obvious problems:

    • It doesn’t scale at all; imagine adding more objects. Would you have two timers for each (one each for the X and Y planes)? Would you add yet another timer to detect collisions for each object?
    • It’s possible for the timers to get out of sync – imagine your code for moving your ship in the X plane takes much longer to run than the code for the Y plane. Suddenly your ship is moving vertically more often than it’s moving horizontally.

    ‘Real’ games have a single loop, which eliminates most of your problems. In pseudo-code:

    1. Check for user input
    2. Work out new X and Y position of ship
    3. Check for collisions
    4. Draw result on screen
    5. Goto 1

    Obviously, there’s more to it than that for anything more than a simple game! But this is the approach you want, rather than trying to have separate loops for everything you’ve got going on.

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

Sidebar

Related Questions

I have a problem with moving animation. I want to create animation which start
I have a ball moving inside a cube, and I detect when it goes
I have an object right now which I have moving in a circle around
In the context of a game program, I have a moving circle and a
I have animation that is an image moving from right to left, which is
I have moving sprites in my game and have added labels on it (CCLabelTTF).
I am developing an android game. in this i have two moving images on
So I have been making this game with Action Script 3, and CS5.5. What
everyone! I have sprite moving by action, what have health bar (progress bar). When
I have a problem moving a Word template from Word 2003 to Word 2007

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.