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.

AppGameKit Classic Chat / Tier 1 - Physics - Impulse

Author
Message
Grook
AGK Backer
12
Years of Service
User Offline
Joined: 22nd Jun 2012
Location: Lancashire, England
Posted: 17th Dec 2013 10:29
Morning all, I'm struggling to get the "feel" I want for a little project I'm playing with using physics. I'm trying to achieve a sort of shuttleboard effect I guess, where you can "flick" an object around the screen. The object should start quite quickly then slow quite quickly too. I'm using SetSpritePhysicsImpulse to give the object a push in the required direction but just can't get the results I want - specifically, the size of the impulse required.



You only get a reasonable "push" around the 100,000 mark and then 1 million and 10 million seem no different at all? I've played around with mass, friction etc. but can't seem to get it right. What am I missing?

It is said that your life flashes before your eyes just before you die. That is true, it's called Life.”
Markus
Valued Member
20
Years of Service
User Offline
Joined: 10th Apr 2004
Location: Germany
Posted: 17th Dec 2013 11:02
i found a example from forum post.



AGK 108 B19 : Windows 8.1 Pro 64 Bit : AMD Radeon HD 6670
Grook
AGK Backer
12
Years of Service
User Offline
Joined: 22nd Jun 2012
Location: Lancashire, England
Posted: 17th Dec 2013 11:40 Edited at: 17th Dec 2013 11:44
Thanks Markus, that's an interesting example. It doesn't use impulse, but adding damping in does give me more of the "feel" I'm looking for though, now if I could just work out the correct impulse values...

EDIT: Got it - SetPhysicsScale is the answer! Thank you so much Markus - much appreciated.

"It is said that your life flashes before your eyes just before you die. That is true, it's called Life.”
Markus
Valued Member
20
Years of Service
User Offline
Joined: 10th Apr 2004
Location: Germany
Posted: 17th Dec 2013 12:10 Edited at: 17th Dec 2013 12:10
jep, physics scale belongs the VirtualResolution.
default scale is for 100x100.

AGK 108 B19 : Windows 8.1 Pro 64 Bit : AMD Radeon HD 6670

Login to post a reply

Server time is: 2024-11-24 23:47:20
Your offset time is: 2024-11-24 23:47:20