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 / Difference between SetSpritePhysicsVelocity and SetSpritePhysicsForce

Author
Message
pinete
13
Years of Service
User Offline
Joined: 28th Jul 2011
Location:
Posted: 17th Aug 2011 18:23
Hi,
Playing with physics example I'm trying to push a ball, I achieve it using SetSpritePhysicsVelocity, what is not recommended in the manual, but SetSpritePhysicsForce doesn't work..

I basically set the point of impact in mouse coordinates but nothing happens..

any clue?
SMS
19
Years of Service
User Offline
Joined: 2nd Dec 2004
Location: United States
Posted: 2nd Dec 2011 07:26
Having the same problem... or a similar one.

The force is applied only for that frame of animation, so you have to keep calling it...

do
sync()
SetSpritePhysicsForce(2,10,10,10,-100)
loop

The problem I am having is that it is not applying force to the COM (center of mass)... so it just rotates.

Is there not a function to apply a force to the COM of a sprite???
baxslash
Valued Member
Bronze Codemaster
17
Years of Service
User Offline
Joined: 26th Dec 2006
Location: Duffield
Posted: 2nd Dec 2011 10:20 Edited at: 2nd Dec 2011 10:20
Here's an example of how to add forces to sprites:


Login to post a reply

Server time is: 2024-11-22 15:17:58
Your offset time is: 2024-11-22 15:17:58