# SetSpritePhysicsForce

## Description

Applies a force to the sprite that will last for this frame only, to continue applying this force you must keep calling this function. The force 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 force. The length of the force vector determines its strength. If the sprite is constrained by surrounding objects it may not move unless the force is large enough to move those objects as well.
Forces apply acceleration to an object relative to its mass, heavy objects will move less than light objects with the same force applied to them.

## Definition

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

void agk::SetSpritePhysicsForce( UINT iSpriteIndex, float x, float y, float vx, float vy )

## Parameters

- iSpriteIndex - The ID of the sprite to modify.
- x - The X coordinate of the force position in world coordinates.
- y - The Y coordinate of the force position in world coordinates.
- vx - The X component of the force direction.
- vy - The Y component of the force direction.