Welcome to the Creatures Wiki! Log in and join the community.

POSX

From Creatures Wiki
Jump to navigation Jump to search
POSX
This article is about a CAOS command or function.
Category [[:Category:CAOS:|]]
Version C1/C2/CV/C3/DS
Command
Parameters
Function
Parameters
Return type [[CAOS types|]]
Related
CAOS POSY
Concepts

POSX is a CAOS function used to check where the centre of an object is in terms of the X-coordinate in the Cartesian plane.

Usage[edit]

Function[edit]

Syntax: POSX (float)

Returns X position of centre of target.

Examples[edit]

From the basic plant script:

subr seed
setv va10 posx
setv va11 posy
reps rand 2 5
new: simp 2 3 50000 "blank" 1 0 1000
attr 195
bhvr 0
elas 0.5
aero 2
accg 0.2
mvsf va10 va11
velo rand -10 10 rand -10 0
tick 5
targ ownr
repe
wait rand 40 90
retn