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

Report as inappropriate.

Builderboy2005
Builderboy2005 presents ...

2009/3/14

Pinball Physics

This is a complicated physics engine designed for Pinball games and the like.
It is still not finished, but it is in a workable state.
Press the mouse to add balls to the simulation

-Made a major change, everything is a lot smoother, and adding balls is faster
-Rolling physics works better

13614 views / 43 in the last 7 days

20 votes | 0 in the last 7 days

Tags: simulation physics demo with-source pinball

This scenario is a member of: Scenario showcase


open in greenfoot
Your browser does not support the canvas tag.
NintoNinto

2009/3/17

Looks much nicer!
A new version of this scenario was uploaded on Wed Mar 18 14:56:57 UTC 2009
mjrb4mjrb4

2009/3/19

Seems to run much better now with lots of balls in the world - nicely done.
Yeah, cause now I'm not giving a copy of the background to each ball ;)
mbreadmbread

2009/3/27

Very nice physics! Seems a little too bouncy against the bottom edges sometimes, when the balls seem to be traveling quite slowly beforehand. You could extend it to have some surfaces that are very bouncy (like the obstacles in the middle of a pinball game) and some which are less so (solid objects, as some areas of the boundary might be) - but that really depends on the nature of the game (I'm not a big pinballer myself...)
Its true that sometimes in the rolling physics, the ball can be kicked up unexpectedly, but its a problem i'm trying to fix.
DonaldDuckDonaldDuck

2010/11/21

I never would have though it to be that difficult to make objects bounce at the correct angle but I guess it would be quite difficult...
Gevater_Tod4711Gevater_Tod4711

2012/10/13

The szenario looks real great but I don't realy get how the balls bounce. I'd like to use something like this in my worms szenario but I can't understand the code. Isn't there an easyer way to make objects bounce off?
DutaDuta

2013/1/2

Gevater, have a look at http://sinepost.wordpress.com/2012/08/30/bouncing-off-the-walls-more-productively/
BradM313BradM313

2013/2/26

Hi, nice "game" I'm using this code for my Pinball game but I got one major problem, I can't figure out how to let the ball bounce back from my "Paddle.class" do you got any idea? Thanks in advance!

See all comments

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

Who likes this?

nachocab askgriff BradM313 Reflection TKPROG Gevater_Tod4711 nooby123 Bytelord smackpotato Itamar.S MathManiac ElJayel pingun spaceblue dang qnanqing tombud999 programmer mjrb4 Ninto