This site requires JavaScript, please enable it in your browser!
Greenfoot back

Report as inappropriate.

Rishav_Agarwal
Rishav_Agarwal presents ...

2014/4/30

Bounce

Any suggestion will be appreciated!!!

3114 views / 18 in the last 7 days

Tags: simulation physics demo with-source ball gravity

open in greenfoot
Your browser does not support the canvas tag.
A new version of this scenario was uploaded on Wed Apr 30 12:57:10 UTC 2014 Any suggestion will be appreciated!!!
A new version of this scenario was uploaded on Wed Apr 30 14:30:56 UTC 2014 Why is it becoming so fast at the end??? I have privided the source code. Plzzz help!!!
danpostdanpost

2014/4/30

In your Ball class act method, you have three separate 'if' blocks, each with a 'setLocation' statement that will move the ball. When more than 10 off the bottom only the middle one will execute. When within then and not at the bottom, the first and third will execute. When at the bottom, all three will execute. That is why your ball speeds up when it is 'rolling' at the bottom.
Oh thanks danpost!!!
A new version of this scenario was uploaded on Thu May 08 12:51:19 UTC 2014 Still there is a bug at the end. Plese help!!!

Want to leave a comment? You must first log in.

Who likes this?

No votes yet.