Category: Objects / Creation
Since engine version: 1.0 OC
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.
int CastObjects(id id, int number, int level, int x, int y, int angle, int angle_variance);
- Type of objects.
- Number of objects.
- Velocity of the objects.
- [opt] X casting position. In local calls offset to the calling object.
- [opt] Y casting position. In local calls offset to the calling object.
- [opt] Angle into which to cast the objects.
- [opt] Maximum deviation from that angle. If not given objects will be cast into all directions.
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