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

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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T08:01:19+00:00 2026-06-01T08:01:19+00:00

After read a lot about ball physics, watch some examples and few days of

  • 0

After read a lot about ball physics, watch some examples and few days of trying making pinball with bitmaps, I need help. I use simple (easy to work with) and fast performance Physics AS3 engine for bitmaps http://coreyoneil.com/portfolio/index.php?project=5 but still cant fix following problem: if ball is moving too fast and object on path is too small, there will be no collision detection (code works perfect only with bigger objects or if ball is moving slower). I am not good at physics and maths. Here is function code which make physics for ball on every frame rate (but maybe its better to change it to setTimeout):

    function showFrame(e:Event) // onEnterFrame
    {
        var collisions:Array = collisionlist.checkCollisions();
        if(collisions.length) // if collision
        {
            var collision:Object = collisions[0]; // get collision information
            var angle:Number = collision.angle; // get collision angle
            var overlap:int = collision.overlapping.length; // get collision overlap
            var sin:Number = Math.sin(angle);
            var cos:Number = Math.cos(angle);
            var vx0:Number = vx * cos + vy * sin;
            var vy0:Number = vy * cos - vx * sin;
            vx0 = ((mass - immovable) * vx0) / (mass + immovable); // var immovable:Number=10000; var mass:Number=immovable*2;
            vx = vx0 * cos - vy0 * sin;
            vy = vy0 * cos + vx0 * sin;
            vx -= cos * overlap / radius; // radius=Math.round(ball.width/2);
            vy -= sin * overlap / radius;
            vx += speed; // var speed:Number=0;
        }           
        vy += gravity; // var gravity:Number=0.75;
        vy *= friction; // var friction:Number=0.981;
        vx *= friction;
        ball.x += vx;
        ball.y += vy;
        //setTimeout(showFrame, 20);
    }
  • 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-01T08:01:21+00:00Added an answer on June 1, 2026 at 8:01 am

    You could use sub steps.

    Its simple but works nicely, basically you divide your velocities by how many steps you want, then have a for loop that tests for collisions on those increments.

    Here is a good example/tutorial: http://www.samclifton.com/tutorials.php?tut=2

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

Sidebar

Related Questions

I read a lot of links and suggestions and after all I'm even more
... after having just read http://www.cocoadev.com/index.pl?CocoaInsecurity ... I am curious to know about your
Ok, after failing to read a polynomial, I'm trying first a basic approach to
after some processing my program shows a messagebox saying you can read a log
I have read a lot about the Java class loading process lately. Often I
I'm really confused about this, tried to read a lot about diagrams but I
I read a lot of documentation about custom module creation for Magento. For my
I'm trying to make something simple with Stripes. I've read and heard a lot
I am currently using Java, I've read a lot about Erlang on the net,
I have read a lot of articles on the net about releasing RCW's safely,

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.