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 / Applying different physics to different sprites...

Author
Message
Funnell7
12
Years of Service
User Offline
Joined: 8th Sep 2011
Location: UK, England
Posted: 10th Jan 2012 23:01
Is it possible to apply different physics to different sprites... For example, what I want to do is apply gravity to everything besides one sprite, and for this one sprite I want to apply impulse. So basically, everything will fall around this one sprite, but I want to be able to move this one sprite using impulse and for it to not be affected by the gravity? Is that possible?

Currently if I set this sprite to physics 'on', it just drops to the ground, but if I turn it 'off', I cannot apply impulse...

Thank you!!
baxslash
Valued Member
Bronze Codemaster
17
Years of Service
User Offline
Joined: 26th Dec 2006
Location: Duffield
Posted: 10th Jan 2012 23:11
If you set gravity to zero in x and y you can manually apply a downward impulse to all the sprites you want like gravity, just leave out the one you don't want gravity to affect.

...or you can make the one sprite a kinetic sprite and manually set it's velocity... probably easier.

Funnell7
12
Years of Service
User Offline
Joined: 8th Sep 2011
Location: UK, England
Posted: 11th Jan 2012 13:44
Baxslash, setting it up as kinetic and applying velocity is perfect!! Thank you very much...
baxslash
Valued Member
Bronze Codemaster
17
Years of Service
User Offline
Joined: 26th Dec 2006
Location: Duffield
Posted: 11th Jan 2012 13:47
Great! Glad to help

Login to post a reply

Server time is: 2024-03-28 12:57:02
Your offset time is: 2024-03-28 12:57:02