Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Newcomers AppGameKit Corner / Best way to implement a pinball flipper type object?

Author
Message
Yaro
6
Years of Service
User Offline
Joined: 29th Mar 2014
Location:
Posted: 18th Mar 2015 06:50
What physics commands would be most useful for trying to emulate a pinball flipper? How about the ball itself, or would just having it set to be a dynamic physics object with the flippers as kinematic work once the flippers are working properly?
baxslash
Valued Member
Bronze Codemaster
13
Years of Service
User Offline
Joined: 26th Dec 2006
Location: Duffield
Posted: 18th Mar 2015 08:43
Yes, you are thinking along the right lines. I would set the flipper angle manually using SetSpriteAngle.

Using AppGameKit V2 Tier 1
Conjured Entertainment
AGK Developer
15
Years of Service
User Offline
Joined: 12th Sep 2005
Location: Nirvana
Posted: 20th Mar 2015 15:11 Edited at: 20th Mar 2015 18:21
My pinball is just the beginnings of a work in progress, so I am not sure if it would be a good example for sharing.
My code is too fresh and probably needs revising, so I do not want to steer you on the wrong path.

I will see if I can scratch out an example of how the flipper is working so far, then you can take it from there.

Hang on, I'll be back...

Edit
Okay man, coming back to this thread I paid more attention to the title and noticed that you are looking for the 'best way'.
Sorry, but this is probably not the best way, but it may be enough to get you started.
I easily get bored with projects and find myself hopping back and forth from my WIPs.
This one is laying around, so I cannibalized the flipper controls for use in this example.
I was not happy with the bounce off the flippers, so maybe some math wizard can modify this a bit.

Anyway... see attached zip.


Coding things my way since 1981 -- Currently using AppGameKit V2 Tier 1

Attachments

Login to view attachments
Yaro
6
Years of Service
User Offline
Joined: 29th Mar 2014
Location:
Posted: 21st Mar 2015 10:07
This is definitely a good place to start, thanks for sharing your work. I'll play around with it and see what I can come up with.

Login to post a reply

Server time is: 2020-09-24 23:20:44
Your offset time is: 2020-09-24 23:20:44