elements


missile

Takes:   id (word)

Returns:   list

Returns a list containing the missile’s position, direction, speed and remaining time / distance. See newmissile

show missile "missileid


missiles

Takes:   class (word)

Returns:   list

Returns a list of currently active missiles belonging to the specified missile class. See newmissile

show missiles "trident


nearmissiles

Takes:   distance or [distance class] or [distance class [position]]

Returns:   list

Returns a list of lists containing the id and class of any missiles within the given distance of the calling turtle, or a list of missile ids if the distance and class are provided as a list. If a third list position parameter is provided nearmissiles returns the missiles near that position.

show nearmissiles 20
show nearmissiles [20 missiles]
show nearmissiles [20 missiles [100 100 0]]


newmissile

Takes:   class (word) | model (word) OR [model1 msdelay model2 msdelay model3…] | [vector] | speed (number) OR [speed [location]] | expiry (milliseconds) or [expiry] (turtle-units)

Returns:   none

Creates a new ‘missile’ with the specified parameters, ‘fired’ from the position of the calling turtle. The first parameter defines the class, or group of missiles, the second defines the turtle model or models used by the missile, the vector is the direction the missile is ‘fired’ in, the speed is the number of turtle-units the missile travels in one second (this parameter can also be provided as a list with the first value being the speed and the second value being the location), and the final parameter defines if the missile expires after a certain number of milliseconds (number) or after it travels a certain distance [number as single list item]. See newmissileid, on, nearmissilep, missile, missilep and stopmissile.

newmissile "missile "turtle forwarddir 20 2000


newmissileid

Takes:   class (word) | model (word) OR [model1 msdelay model2 msdelay model3…] | [vector] | speed (number) OR [speed [location]] | expiry (milliseconds) or [expiry] (turtle-units)

Returns:   id (word)

Creates a new ‘missile’ with the specified parameters and returns the name of the missile. See newmissile for complete syntax

show newmissileid "missile "turtle forwarddir 20 2000


stopmissile

Takes:   id (word) or [id model1 msdelay model2 msdelay…]

Returns:   none

Stops the missile of the given id, displaying the optional animation before de-existing. The animation is created using the thread that calls stopmissile, so to prevent it from blocking, it needs to be executed by a newworker eg newworker [stopmissile [id anim1 100 anim2 100]]

stopmissile "id
stopmissile [id anim1 100 anim2 100 anim3 100]


stopmissiles

Takes:   class (word) or [class model1 msdelay model2 msdelay…]

Returns:   none

Stops the missiles of the given class, displaying the optional animation before de-existing them.

stopmissiles "class
stopmissiles [class anim1 100 anim2 100 anim3 100]