# SimFlight

Objects
Movement
4.9.5.0 CE
bool
int & x X coordinate of the starting position. Always global.
int & y Y coordinate of the starting position. Always global.
int & xdir Initial horizontal speed.
int & ydir Initial vertical speed.
int min_density Mininum density of the material which will stop the projected trajectory. If not specified or 0 this will default to value 50 (solid material).
int max_density Maximum density of the material which will stop the projected trajectory. If not specified or 0 this will default to value 50 (solid material).
int iterations Number of simulated frames for which the projection runs. If not specified or 0 the simultion will run indefinitely until material or the limits of the landscape are encountered.
int precision Precision. Default 10 if not specified or 0.
Simulates the motion of a falling object with a given starting position and initial speed. If the projected trajectory encounters a material of the specified density, the simulation will stop and the function will return 'true'. Otherwise the function will return 'false'.
If the return value is 'true', the x and y coordinates of the point of interception will be stored in the specified variables for x and y, the horizontal and vertical speed at the time of interception in xdir and ydir respectively. See references for details.
var x = GetX(), y = GetY(), xdir = GetXDir(), ydir = GetYDir(); if (GetAction()eq"Jump") if (SimFlight(x, y, xdir, ydir)) if (ydir >= 80) Message("Oh oh, das wird ein harter Aufprall!");
If the calling clonk is situated in mid-air and it appears that he will hit the ground at high speed, he will call out.
Newton
2004-03