SetSpritePhysicsImpulse

Description

Similar to a force but applied only once. Whilst forces are applied continuously over time gradually influencing a sprite's velocity, an impulse simulates the sprite being hit suddenly and immediately changes the velocity with the equivalent power of a similar force applied for 1 second.

The impulse consists of a point in world coordinates and a direction, if the point and direction are not in line with the sprite's offset point then it will result in a rotation of the sprite as it is moved by the impulse. The length of the impulse vector determines it strength. If the sprite is constrained by surrounding objects it will impart the impulse onto those objects and may not move itself.

Impulses apply acceleration to an object relative to its mass, heavy objects will move less than light objects with the same impulse applied to them.

Definition

SetSpritePhysicsImpulse( iSpriteIndex, x, y, vx, vy )

Parameters