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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T06:25:02+00:00 2026-06-07T06:25:02+00:00

There is an arc that detects where the bottom object is. This arc, or

  • 0

There is an arc that detects where the bottom object is. This arc, or ball, bounces fine until the 2nd bounce, and glitches out in the floor. The variable ball.gSy controls the speed in which the ball falls. Right now it’s being multiplied by 10 (ball.y += 10*ball.gSy;) to speed up the effects of the glitching in the floor. Also, you can use the arrow keys to control the ball, and it does get stuck in the side walls, but the bottom floor issue is the one I’m particularly curious about.

Here is a jsfiddle link to better satisfy your patronage:
http://jsfiddle.net/nhQtk/

  • 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-07T06:25:04+00:00Added an answer on June 7, 2026 at 6:25 am

    Your problem is that you move the ball down, but when there’s a collision, you’re not moving the ball back up to a position where it’s not stuck in the floor.

    So you are correctly detecting a collision, but your ball is already partly through the wall and can’t move back up.

    Here’s a rough idea of what you need to do:

     ball.y += 10*ball.gSy;
     for(var i = 0; i < objects.length; i++){
                            if(ball.x > objects[i].x - ball.r &&
                              ball.y > objects[i].y - ball.r && 
                              ball.x < ball.r + objects[i].x + objects[i].w &&
                              ball.y < ball.r + objects[i].y + objects[i].h)
                          {
                                ball.gSy = (-1 * ball.gSy);
                                ball.y -= 10;// <--- important step
                                // You need to calculate how much to move the ball BACK up to where it has not quite hit the floor.   
    
                           }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

There is a column that exists in 2 tables. In table 1, this column
Now that there is ARC You cannot create a new NSAutoRelease pool... yet it
There is a gap in my understanding of blocks and ARC that I would
Is there a way to draw an arc using points in JavaScript?? I need
I have container of geometrical entities. Let's assume there is circle, ellipse, line, arc.
There is a moment in my app, that I need to force to show
There are nice SO question and answers about this issue, but these options didn't
Is there an iOS 5 arc compatible lazy Image loading library? I've not found
There are two new memory management attributes for properties introduced by ARC, strong and
In a ARC enabled project, is there a way to add the -fno-objc-arc tag

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.