Robot-Specific Blocks#
Introduction#
The Rover Rescue Playground features blocks exclusive to the VR Rover, including custom Drivetrain, Actions, and Sensing category blocks.
The VR Rover has access to the standard VR Events, Control, Operators, Variables, My Blocks, and Comments blocks.
Below is a list of all available Playground-specific Blocks:
Drivetrain - Move and monitor the VR Rover.
Actions
drive - Drives the VR Rover continuously forward or in reverse.
drive for - Drives the VR Rover for a set distance.
turn - Turns the VR Rover continuously left or right.
turn for - Turns the VR Rover a specific number of degrees.
turn to heading - Turns the VR Rover to face a specific heading.
go to object - Turns and drives the VR Rover to the selected object.
stop driving - Stops all rover movement.
Settings
set drive velocity - Sets the speed for drive blocks.
set turn velocity - Sets the speed for turn blocks.
set drive heading - Manually sets the rover’s heading value.
set drive timeout - Limits how long drivetrain blocks wait to reach their target.
Values
drive is done? - Returns whether the drivetrain is no longer moving.
drive is moving? - Returns whether the drivetrain is currently moving.
drive heading - Returns the drivetrain’s current heading in degrees.
Actions - Interact with the rover’s resources, enemies, and built-in AI systems.
Actions
minerals action - Picks up, drops, or uses minerals.
absorb enemy radiation - Absorbs radiation from an enemy.
standby - Puts the VR Rover into standby mode until a battery threshold is reached.
Values
rover sees - Returns whether the VR Rover sees an object in its vision range.
rover detects - Returns whether the VR Rover detects minerals or enemies in its detect radius.
minerals in storage - Returns how many minerals the VR Rover is carrying.
storage capacity - Returns the VR Rover’s current carrying capacity.
rover direction - Returns the direction to an object in degrees.
rover distance - Returns the distance to an object in millimeters or inches.
rover location - Returns the X or Y coordinate of an object in millimeters or inches.
under attack? - Returns whether the VR Rover is currently under attack.
enemy level - Returns the level of the closest detected enemy.
enemy radiation - Returns the radiation of the closest detected enemy.
battery level - Returns the VR Rover’s current battery level in %.
level - Returns the VR Rover’s current level.
XP - Returns the VR Rover’s current experience points.
when under attack - Runs attached blocks when the VR Rover is attacked.
when level up - Runs attached blocks when the VR Rover levels up.
Sensing - Detect nearby objects with the rover’s Distance Sensor.
Distance found an object? - Returns whether the Distance Sensor detects an object.
object distance - Returns the distance to the nearest detected object.
The examples on this page use the default Playground start position.
Drivetrain#
Actions#
drive#
The drive block moves the drivetrain forward or in reverse using the current drive velocity. This block runs continuously until another Drivetrain block interrupts it or the project stops.
unidad [adelante v]
Parameters |
Description |
|---|---|
direction |
The direction the robot drives:
|
Example
cuando empezó
[Drive forward, then stop.]
unidad [adelante v]
esperar (2) segundos
deja de conducir
drive for#
The drive for block moves the drivetrain forward or in reverse for a specified distance using the current drive velocity.
unidad [adelante v] para (200) [mm v] ▶
Parameters |
Description |
|---|---|
direction |
The direction the robot drives:
|
distance |
The distance the robot drives, as an integer or decimal. |
unit |
The unit of measurement:
|
expanding arrow |
By default, this is a waiting block, so the drivetrain will finish moving before running the next block. Expand the block to say and don’t wait to make it non-waiting. |
Example
cuando empezó
[Drive forward for 500 mm.]
unidad [adelante v] para (500) [mm v] ▶
turn#
The turn block turns the drivetrain continuously left or right using the current turn velocity. The drivetrain will keep turning until another Drivetrain block runs or the project stops.
turno [derecha v]
Parameters |
Description |
|---|---|
direction |
The direction the robot turns:
|
Example
cuando empezó
[Turn right, then stop.]
turno [derecha v]
esperar (2) segundos
deja de conducir
turn for#
The turn for block turns the drivetrain left or right for a specific number of degrees using the current turn velocity.
girar [derecha v] por (90) grado ▶
Parameters |
Description |
|---|---|
direction |
The direction the robot turns:
|
angle |
The number of degrees the robot turns, as an integer or decimal. |
expanding arrow |
By default, this is a waiting block, so the drivetrain will finish turning before running the next block. Expand the block to say and don’t wait to make it non-waiting. |
Example
cuando empezó
[Turn left, then turn right.]
girar [izquierda v] por (90) grado ▶
girar [derecha v] por (180) grado ▶
turn to heading#
The turn to heading block turns the drivetrain to face a specific heading using the current turn velocity.
girar hacia el rumbo (90) grados ▶
Parameters |
Description |
|---|---|
heading |
The absolute heading the drivetrain will turn to, from -360 to 360 degrees. |
expanding arrow |
By default, this is a waiting block, so the drivetrain will finish turning before running the next block. Expand the block to say and don’t wait to make it non-waiting. |
Example
cuando empezó
[Turn to face east.]
girar hacia el rumbo (90) grados ▶
go to object#
The go to object block turns and drives the VR Rover to the selected object.
go to [minerals v] ▶
Parameters |
Description |
|---|---|
object |
Which object the VR Rover will go to:
|
expanding arrow |
By default, this is a waiting block, so the rover will finish moving before running the next block. Expand the block to say and don’t wait to make it non-waiting. |
If the VR Rover detects multiple minerals or multiple enemies, it will move to the closer option.
If minerals or an enemy are not detected in the rover’s visual range when the block runs, the robot will not drive. The base can always be targeted.
Example
cuando empezó
[Drive to the closest mineral.]
go to [minerals v] ▶
stop driving#
The stop driving block immediately stops all movement of the drivetrain.
deja de conducir
Parameters |
Description |
|---|---|
This block has no parameters. |
Example
cuando empezó
[Drive forward, then stop.]
unidad [adelante v]
wait (4) seconds
deja de conducir
Settings#
set drive velocity#
The set drive velocity block sets the default movement speed as a percentage for all subsequent drive blocks in the project. By default, the drive velocity is set to 50%.
Establezca la velocidad de la unidad en (50) [% v]
Parameters |
Description |
|---|---|
velocity |
Sets the default movement velocity from 0% to 100%. |
Example
cuando empezó
[Move faster.]
Establezca la velocidad de la unidad en (100) [% v]
unidad [adelante v] para (100) [mm v] ▶
set turn velocity#
The set turn velocity block sets the default velocity as a percentage for all subsequent turn blocks in the project. By default, the turn velocity is set to 50%.
establecer la velocidad de giro a (50) [% v]
Parameters |
Description |
|---|---|
velocity |
Sets the default turn velocity from 0% to 100%. |
Example
cuando empezó
[Turn faster.]
set turn velocity to (100) [% v]
girar [derecha v] por (90) grado ▶
set drive heading#
The set drive heading block sets the gyro’s current heading to a specified value.
establecer el rumbo de la unidad a (0) grados
Parameters |
Description |
|---|---|
heading |
The heading value to assign, in degrees. |
Example
cuando empezó
[Set the heading, then turn to 0 degrees.]
establecer el rumbo de la unidad a (90) grados
girar hacia el rumbo (0) grados ▶
set drive timeout#
The set drive timeout block sets a time limit for how long a Drivetrain block will wait to reach its target. If the robot cannot complete the movement within the set time, it will stop automatically and continue with the next block.
Note: The drivetrain’s time limit is used to prevent Drivetrain blocks that do not reach their target position from stopping the execution of other blocks in the stack.
Establezca el tiempo de espera de la unidad en (1) segundos
Parameters |
Description |
|---|---|
time |
The maximum number of seconds a Drivetrain block will run before stopping and moving to the next block. |
Example
cuando empezó
[Drive for at most 1 second.]
Establezca el tiempo de espera de la unidad en (1) segundos
unidad [adelante v] para (25) [pulgadas v] ▶
Values#
drive is done?#
The drive is done? block returns a Boolean indicating whether the drivetrain is not moving.
True - The drivetrain is not moving.
False - The drivetrain is moving.
Note: This block only detects movement from blocks that can expand to show the and don’t wait option.
<¿La unidad está lista?>
Parameters |
Description |
|---|---|
This block has no parameters. |
Example
cuando empezó
[Start turning when the drive is complete.]
unidad [adelante v] para (200) [mm v] ◀ y no esperes
esperar hasta <¿La unidad está lista?>
girar [derecha v] por (360) grado ▶
drive is moving?#
The drive is moving? block returns a Boolean indicating whether the drivetrain is moving.
True - The drivetrain is moving.
False - The drivetrain is not moving.
Note: This block only detects movement from blocks that can expand to show the and don’t wait option.
<¿La unidad se está moviendo?>
Parameters |
Description |
|---|---|
This block has no parameters. |
Example
cuando empezó
[Print while the rover is moving.]
unidad [adelante v] para (200) [mm v] ◀ y no esperes
mientras <¿La unidad se está moviendo?>
imprimir [Still Moving...] ▶
esperar (0.1) segundos
borrar todas las filas
fin
imprimir [Done!] ▶
drive heading#
The drive heading block returns the drivetrain’s heading angle as a decimal number, in the range 0 to 359.99 degrees.
(rumbo de la unidad en grados)
Parameters |
Description |
|---|---|
This block has no parameters. |
Example
cuando empezó
[Display the heading after turning.]
girar [derecha v] por (90) grado ▶
imprimir (rumbo de la unidad en grados) ▶
colocar el cursor en la siguiente fila
Actions#
Actions#
minerals action#
The minerals action block interacts with minerals in the Rover Rescue Playground.
minerals [pick up v]
Parameters |
Description |
|---|---|
action |
What to do with minerals:
|
Picking up minerals stores them in the VR Rover until they are dropped or used.
Using minerals replenishes some of the VR Rover’s energy. Minerals can only be used if they are on the ground.
The VR Rover gains Experience Points (XP) by using minerals or dropping them at the base.
Example
cuando empezó
[Drive to the closest mineral and pick it up.]
go to [minerals v] ▶
minerals [pick up v]
absorb enemy radiation#
The absorb enemy radiation block absorbs radiation from an enemy in the Rover Rescue Playground.
absorb radiation
Parameters |
Description |
|---|---|
This block has no parameters. |
Example
cuando empezó
[Drive to the closest enemy and absorb radiation.]
go to [enemy v] ▶
absorb radiation
standby#
The standby block puts the VR Rover into standby mode until the specified battery threshold is reached.
standby until [50] % battery
Parameters |
Description |
|---|---|
percent |
The battery threshold that causes the VR Rover to exit standby mode, from 0 to 100. |
While in standby, the VR Rover uses its battery more slowly, but the Number of Days Survived counter increases at a higher rate.
When the battery reaches the selected threshold, the VR Rover exits standby mode and returns to normal battery usage and day progression.
If the selected threshold is equal to or above the current battery level, the VR Rover will not enter standby mode.
Example
cuando empezó
[Wait in standby until battery reaches 35%.]
standby until [35] % battery
go to [minerals v] ▶
Values#
rover sees#
The rover sees block returns a Boolean indicating whether the VR Rover sees the selected object using its built-in AI technology.
True - The selected object is within 1000 millimeters of the VR Rover and within its field of view.
False - The selected object is farther than 1000 millimeters away and/or outside the field of view.
<sees [minerals v]?>
Parameters |
Description |
|---|---|
object |
Which object to check for:
|
The VR Rover’s field of view is 40 degrees, shown in the mini-map as the gray translucent cone extending from the front of the rover.
Example
cuando empezó
para siempre
if <sees [minerals v]?> then
go to [minerals v] ▶
fin
fin
rover detects#
The rover detects block returns a Boolean indicating whether the VR Rover detects minerals or enemies using its built-in AI technology.
True - The selected object is within the rover’s detect radius.
False - The selected object is not within the rover’s detect radius.
<detects [minerals v]?>
Parameters |
Description |
|---|---|
object |
Which object to detect:
|
The VR Rover’s detect radius is 800 millimeters, shown in the mini-map as the yellow circle around the rover.
Example
cuando empezó
para siempre
if <detects [minerals v]?> then
go to [minerals v] ▶
fin
fin
minerals in storage#
The minerals in storage block returns the current amount of minerals the VR Rover has in its storage.
(minerals in storage)
Parameters |
Description |
|---|---|
This block has no parameters. |
Example
cuando empezó
print (minerals in storage) ▶
colocar el cursor en la siguiente fila
storage capacity#
The storage capacity block returns the carrying capacity of the VR Rover’s storage.
(storage capacity)
Parameters |
Description |
|---|---|
This block has no parameters. |
Example
cuando empezó
print (storage capacity) ▶
colocar el cursor en la siguiente fila
rover direction#
The rover direction block returns the direction from the VR Rover to the selected object in degrees.
([minerals v] direction in degrees)
Parameters |
Description |
|---|---|
object |
Which object’s direction to report:
|
For minerals and enemies, this block only reports values when the selected object is within 1000 millimeters and inside the rover’s 40 degree field of view.
If base is selected, the direction is reported even when the base is not in the field of view. For the base, this block reports a value from -180 to 180 degrees.
Example
cuando empezó
print ([minerals v] direction in degrees) ▶
colocar el cursor en la siguiente fila
rover distance#
The rover distance block returns the distance from the VR Rover to the selected object.
([minerals v] distance in [mm v] :: custom-actions)
Parameters |
Description |
|---|---|
object |
Which object’s distance to report:
|
unit |
The unit used to report the distance:
|
For minerals and enemies, this block only reports values when the selected object is within 1000 millimeters and inside the rover’s 40 degree field of view.
If base is selected, the distance is reported even when the base is not in the field of view.
Example
cuando empezó
print ([minerals v] distance in [mm v] :: custom-actions) ▶
colocar el cursor en la siguiente fila
rover location#
The rover location block returns the X or Y coordinate of the selected object using the rover’s built-in AI technology.
([minerals v] location [X v] in [mm v])
Parameters |
Description |
|---|---|
object |
Which object’s location to report:
|
axis |
Which coordinate to return:
|
unit |
The unit used to report the coordinate:
|
For minerals and enemies, this block only reports values when the selected object is within 1000 millimeters and inside the rover’s 40 degree field of view.
If base is selected, the location is reported even when the base is not in the field of view.
Example
cuando empezó
print ([base v] location [X v] in [mm v]) ▶
colocar el cursor en la siguiente fila
print ([base v] location [Y v] in [mm v]) ▶
colocar el cursor en la siguiente fila
under attack?#
The under attack? block returns a Boolean indicating whether the VR Rover is currently under attack from an enemy.
True - The VR Rover is under attack.
False - The VR Rover is not under attack.
<under attack?>
Parameters |
Description |
|---|---|
This block has no parameters. |
Example
cuando empezó
para siempre
if <under attack?> then
drive [reverse v] for [500] [mm v] ▶
fin
fin
enemy level#
The enemy level block returns the level of the closest enemy detected by the VR Rover.
(enemy level)
Parameters |
Description |
|---|---|
This block has no parameters. |
When no enemies are detected in the VR Rover’s detect radius, this block returns 0.
Example
cuando empezó
para siempre
if <(enemy level) [math_equal v] [1]> then
go to [enemy v] ▶
demás
drive [reverse v] for [500] [mm v] ▶
fin
fin
enemy radiation#
The enemy radiation block returns the radiation of the closest enemy detected by the VR Rover.
(enemy radiation)
Parameters |
Description |
|---|---|
This block has no parameters. |
When no enemies are detected in the VR Rover’s detect radius, this block returns 0.
Example
cuando empezó
print (enemy radiation) ▶
colocar el cursor en la siguiente fila
battery level#
The battery level block returns the current battery level of the VR Rover as a percent.
(battery level in % :: custom-actions)
Parameters |
Description |
|---|---|
This block has no parameters. |
Example
cuando empezó
print (battery level in % :: custom-actions) ▶
colocar el cursor en la siguiente fila
level#
The level block returns the current level of the VR Rover.
(level)
Parameters |
Description |
|---|---|
This block has no parameters. |
Example
cuando empezó
print (level) ▶
colocar el cursor en la siguiente fila
XP#
The XP block returns the current number of Experience Points the VR Rover has.
(XP)
Parameters |
Description |
|---|---|
This block has no parameters. |
Example
cuando empezó
print (XP) ▶
colocar el cursor en la siguiente fila
when under attack#
The when under attack block runs its attached stack each time the VR Rover is attacked by an enemy.
when under attack
Parameters |
Description |
|---|---|
This block has no parameters. |
Example
when under attack
absorb radiation
when level up#
The when level up block runs its attached stack each time the VR Rover moves from one level to the next.
when level up
Parameters |
Description |
|---|---|
This block has no parameters. |
Example
when level up
print [The VR Rover has leveled up!] ▶
colocar el cursor en la siguiente fila
Sensing#
Distance#
Distance found an object?#
The Distance found an object? block returns a Boolean indicating whether the Distance Sensor has detected an object within 2000 mm.
True - The Distance Sensor has detected an object.
False - The Distance Sensor has not detected an object.
<[distance v] found an object?>
Parameters |
Description |
|---|---|
distance sensor |
Which Distance Sensor to use. In this Playground, the available sensor is |
Example
cuando empezó
[Turn until the Distance Sensor detects an object.]
turno [derecha v]
wait until <[distance v] found an object?>
deja de conducir
object distance#
The object distance block returns the distance of the nearest object from the Distance Sensor.
([distance v] in [mm v])
Parameters |
Description |
|---|---|
distance sensor |
Which Distance Sensor to use. In this Playground, the available sensor is |
unit |
The unit of measurement:
|
Example
cuando empezó
[Wait until the Distance Sensor detects an object, then print the distance.]
turno [derecha v]
wait until <[distance v] found an object?>
deja de conducir
print ([distance v] in [mm v]) ▶