integer GetX()
Return the voxel x coordinate of the robot position in the world.
none
An integer number giving the x 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();
}
}
GetY()
GetZ()