CastObjects

Category: Objects / Creation
Since engine version: 1.0 OC

Description

Casts number objects at the specified position with speed level. For local calls the created objects will have the same owner as the calling object. The objects that were created are returned in an array.

Syntax

int CastObjects(id  id, int  number, int  level, int  x, int  y, int  angle, int  angle_variance);

Parameters

id:
Type of objects.
number:
Number of objects.
level:
Velocity of the objects.
x:
[opt] X casting position. In local calls offset to the calling object.
y:
[opt] Y casting position. In local calls offset to the calling object.
angle:
[opt] Angle into which to cast the objects.
angle_variance:
[opt] Maximum deviation from that angle. If not given objects will be cast into all directions.

Example

var num=GetVertexNum()-1;
CastObjects(MagicSpark,1,20,GetVertex(num, 0)-GetX(), GetVertex(num, 1)-GetY());
				
Creates a spark at the last vertex of a line. With multiple calls this will create the same effect as a lightning strike.
See also: CreateObject
Günther, 2002-02
Newton, 2009-07
Marky, 2015-07