to Compass Direction
Convert the angle in degrees given to the closest game compass direction.
positions.toCompassDirection(DEGREES0)
Compass directions in the game are North
, South
, East
, and West
. A direction angle in degrees is converted to the closest one of these directions.
Parameters
- deg: a number that is the degree angle that will get converted to a compass direction.
Returns
- a compass direction that is closest to the degree angle given.
Example
Example
Teleport the Agent 9
blocks in the direction closest to 212 degrees.
agent.teleport(pos(9, 0, 0), positions.toCompassDirection(212))