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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T16:52:05+00:00 2026-06-03T16:52:05+00:00

I made a simple ball bouncing program with VC++. the goal of this program

  • 0

I made a simple ball bouncing program with VC++.
the goal of this program is that ball must bounce in the rhombus. it cannot go out of rhombus.

It seems that it runs successfully, but in the left and right corner, it stuck.
How to resolve this problem? I think the condition of equlation is duplicated when the ball is going to left and right corner…
Can you suggest other algorithm for solve this problem?

i tried to make this problem like
while(!isInside(getNextPos(circle))) { updateDirectionVector(circle); }
but I cannot do like this because a random value has changed in everytime. (Used Timer to repeat)

This is algorithm of this program which is worked except at the corner.

up:
while(1) goDownSideCircle;
if(StuckOnDownSide) goto down;
down:
while(1) goUpSideCircle;
if(StuckOnUpSide) goto up;
  • 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-03T16:52:08+00:00Added an answer on June 3, 2026 at 4:52 pm

    Problem Solved.

    Solved Algorithm:

        RandValue;
        while(1){
        DrawCircle(Center_X,Center_Y);
        Center_X+=Rand_X; Center_Y+=Rand_Y;
        check=false;
        Check_X=Center_X; Check_Y=Center_Y;
        while(BorderCheck){
        RandValue;
        Check_X+=Rand_X; Check_Y+=Rand_Y;
        check=true;}
        if(check){
        Center_X=Check_X; Center_Y=Check_Y;}}
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I made this simple function to filter the data. I add the symbols that
I'm learning java and I have made simple program that simply reads value from
I made a simple program that allows the user to pick a number of
We made a simple application and using GoogleAppEngineLauncher (GAEL) ran that locally. Then we
I made a simple application that adds 1 to the count and displays the
How would you make this slider navigation bar go in loop? I made simple
I made a simple gallery, using this script to show the images: $rs =
Made a simple script that hide/show a hidden div. The page automatically adjusts its
I made simple plugin and i would like to work this plugin only below
My PHP is not PHPing, so made simple test... must be missing something obvious.

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.