integer GetY()
Return the voxel y coordinate of the robot position in the world.
none
An integer number giving the y coordinate of the robot in the world.
// Listing #1: Position display demo
Time <- 0;
function Voxel_Step()
{
local x,y,z;
// The robot will play at 5 second interval.
if ( (GetGameTime() - Time) > 5000 )
{
// Move randomly
Move ( GetRnd(3) );
// Get the coordinates of the robot
x = GetX();
y = GetY();
z = GetZ();
// Display coordinates on screen
Display( "ROBOT IS AT " + x + "," + y + "," + z, 5000, 2);
// Store actual timestamp for the next 5 second delay.
Time = GetGameTime();
}
}
GetX()
GetZ()