AGK for Pascal
ContentsIndexHome
PreviousUpNext
TAgkForce.Create Constructor

Creates a global force that affects all physics sprites.

Syntax
Pascal
constructor Create(const Owner: TAgkObject; const X: Single; const Y: Single; const Power: Single; const Limit: Single; const Range: Single; const Fade: Boolean);
Parameters 
Description 
const Owner: TAgkObject 
the owner of the new force (eg. a TAgkScene object). 
const X: Single 
The X position of the force location in world coordinates. 
const Y: Single 
The Y position of the force location in world coordinates. 
const Power: Single 
The strength of the force at 1 unit from the force point for fading forces, or the strength at all times for non fading. 
const Limit: Single 
Applies to fading forces only, the maximum force that will be applied to a sprite, used when the sprite is closer than 1 unit. 
const Range: Single 
The range that this force can act, sprites greater than this distance from the force point feel no effects. Less than 0 means infinite range. 
const Fade: Boolean 
Set to True if the force should be weaker when sprites are further from the force point, False if the force is equal at all distances. 

Can be set to either attract to or repel sprites from a specific location. Forces continue to act until they are deleted. 

TAgkForce

Copyright (c) 2012. All rights reserved.