This project has moved and is read-only. For the latest updates, please go here.

Pinball Physics

Topics: User Forum
Apr 24, 2009 at 12:14 PM
Hi, I tried making a simple pinball prototype using farseer. I have the basic mechanics working but to make it feel like pinball I'm struggling a little.
Heres a screenshot of my pinball table

With the side triangle bumpers, the ball bounces from it, however i want it to be a spring effect when hit just like a real table. Can this be achieved with springs?
I'm fairly new to physics so the values to use to make it feel realistic are proving dificult to get with trial and error :)
Does anyone have any recomendations for things like the friction of the paddles, ball, walls, bumpers etc.

Also, on the paddles i have a spring and a joint holding them in place. To move when i hit a key i apply an impulse to the edge of the paddle in the direction of X:0 Y:-1000

Is this the best way to get the paddle to spin up and back down ? the spring works as i expect and puts it back in place but it seems to try and move rather than just rotate around the joint.
The biggest problem here is because its such a quick movement the ball passes right through and gets hit by the paddle on the way down.

Another problem with the paddles is i want to hold them in place if the key is held down, is the best way to do this adding a new joint to hold it in place again until the key is released? if so how could i achieve this by using the analog triggers on the controller, so slowly changing the value of the right trigger would move the paddle up and down respectivly.. hitting the trigger once would make it flip up quickly as you;d expect.

Any tips and help would be apreciated a ton..


Oh and by the way, I'm writing a plugin for our editor for integration with farseer. Once it's done i'll post the release for anyone interested :)
Apr 24, 2009 at 10:05 PM
Edited Apr 24, 2009 at 10:06 PM
For my pinball game that I created a while ago.  I used a fixed angle spring for the flippers, and for the bumpers I sett them to be just a regular polygon geom, and I applied an impulse at a specific angle for the triangle ones, and an impulse in the opposite angle the ball was traveling for the circle ones.  This impulse was applied whenever the ball and bumper collided via the onCollision event.
Apr 25, 2009 at 1:04 AM
The other thing you could do is set the restitution coefficient for the side triagle bumper geoms above 1. This will cause the object to gain speed when it bounces off of said bumpers, simulating a springy surface.