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.

Windows / Applying High Impulse/Force to a sprite

Author
Message
ikenstar
10
Years of Service
User Offline
Joined: 26th Apr 2013
Location:
Posted: 15th Jul 2013 15:10
I am making a pool kind of game. I couldn't apply high force or impulse to the cue ball with high velocity.

"
".

I am applying force on OnMouseClick event

I have tried "force" with high value like 100000 still the sprite moves in same velocity as it was moving with 100.

Correct me if I made any mistake

Rakesh-
Ancient Lady
Valued Member
20
Years of Service
User Offline
Joined: 17th Mar 2004
Location: Anchorage, Alaska, USA
Posted: 15th Jul 2013 20:52
You might want to use SetSpritePhysicsImpulse or SetSpritePhysicsVelocity instead of SetSpritePhysicsForce.

SetSpritePhysicsForce only applies for one sync cycle and then the sprite drops back to what it was before. It does not build up and a higher value is not apparent over one frame.

Look at the descriptions for the other two.

Your sprite movement is also affected by the restitution, friction and damping (SetSpritePhysics<x>, where <x> is each of these things).

Cheers,
Ancient Lady
AGK Community Tester and AppGameKit Master
easter bunny
11
Years of Service
User Offline
Joined: 20th Nov 2012
Playing: Dota 2
Posted: 29th Jul 2013 09:56
is the ball moving when you hit it?
if it isn't, then you can get more/simpler control over it by using SetSpritePhysicsVelocityX(id) and SetSpritePhysicsVelocityY(id)

Login to post a reply

Server time is: 2024-04-19 13:39:38
Your offset time is: 2024-04-19 13:39:38