Robot Command Reference

This is a list of all the robot commands in CodeGroove, arranged by category.

Options for each command are shown in [square brackets].

Robot

These commands affect the robot itself, making it move, change appearance, and so on.

Become
Become [block options]

Changes the robot into the block you choose. After changing, the robot is gone and can't be turned back.

Delete me
Delete me

Deletes the robot from the board. Once deleted, the robot is gone for the rest of the game.

Delete me as an item
Delete me as an item

Deletes the robot and moves the player onto its square. Use this to create a 'pick up' effect for robots that are acting as special items.

Face
Face [direction]

Makes the robot face in the direction you choose. If the robot is being shown as an item, this has no effect.

Go
Go [direction] [steps]

Moves the robot in the given direction, for the given number of steps.

Go to square
Go to square [x coord] [y coord]

Makes the robot jump immediately to the square with the given coordinates.

Set colour
Set colour [colour]

Changes the robot's colour to the one you choose.

Set picture
Set picture to [picture]

Changes the robot's picture to the one you choose. If the robot is being shown as a character, you should choose the first picture in the set, i.e. the one facing north.

Shoot
Shoot [direction]

Makes the robot shoot a bullet in the given direction.

Shoot fire
Shoot fire [direction]

Makes the robot shoot a fireball in the given direction.

Wait
Wait [turns]

Makes the robot wait for a number of turns.

Program

These commands affect the flow of the robot's program.

Accept messages
Accept messages

Tells the robot to start accepting messages from other robots and the rest of the world. Use this after the Ignore Messages command.

Blank line
Blank line
Does nothing. Use blank lines to add space between parts of the program to make it easier to read.

Comment
Comment

Does nothing. Use comments to leave notes to other people (or yourself) explaining what the program does.

Disable label
Disable label [label name]

Tells the robot to disable any labels matching the given name. Disabled labels are ignored by the Jump To command.

Enable label
Enable label [label name]

Re-enables a label that was previously disabled.

Ignore messages
Ignore messages

Tells the robot to ignore incoming messages from other robots, and from the world (such as shot, bombed, and so on.)

Jump to
Jump to [label name]

Makes the program jump to the label matching the given name. If the label has been disabled or doesn't exist then this command is ignored.

Label
Label [label name]

Creates a label with the given name. You can make the program jump to this point using the Jump To command.

Send
Send [robot name] [label name]

Tells the robot with the given name to jump to the given label name. If the robot doesn't have a label with that name, it ignores the message.

Stop
Stop

Makes the program stop entirely. The program will only start again when it receives a message it has a label for.

World

These commands affect the rest of the game world.

Move player
Move player [direction]

Makes the player move in the given direction.

Move player to square
Move player to square [x coord] [y coord]

Makes the player jump immediately to the square with the given coordinates.

Push
Push to [direction]

Makes the robot try pushing in the given direction. If there's something pushable in the way, it will move. The robot itself doesn't move.

Put
Put [block options] to [direction]

Puts the block you choose in the given direction. If there's something else there, it will be overwritten (unless it's the player.)

Put on square
Put [block options] on square [x coord] [y coord]

Puts the block you choose on the square with the given coordinates. If there's something else there, it will be overwritten (unless it's the player.)

Show message
Show message [text]

Shows a message box to the player with the text you enter.

Try to put
Try to put [block options] to [direction]

Puts the block you choose in the given direction, but only if there's nothing already in the way.

Variables

These commands let you perform actions on variables, and change the flow of the program based on the value of a variable.

Add
Add [number] to [variable]

Adds the given number to the given variable.

If
If [value 1] [condition] [value 2] ... Else

Compares two values using the given condition (see examples). If the comparison is true, the commands between If and Else are carried out. Otherwise, the commands after Else are carried out instead.

If any
If any [block options] ... Else

If there are any of the specified blocks on the board, the commands between If and Else are carried out. Otherwise, the commands after Else are carried out instead.

If not any
If not any [block options] ... Else

If there are none of the specified blocks on the board, the commands between If and Else are carried out. Otherwise, the commands after Else are carried out instead.

If player is on square
If player is on square [x coord] [y coord] ... Else

If the player is on the square with the given coordinates, the commands between If and Else are carried out. Otherwise, the commands after Else are carried out instead.

Input
Input [variable] with message [text]

Shows a popup box to the player with the given text. The player can then type something into the box. The value that they enter is then put into the given variable.

Set
Set [variable] to [value]

Sets the given variable to the given value.

Set random
Set [variable] to random number between [low] and [high]

Sets the given variable to a random number between the two numbers you specify. The numbers are inclusive, so if you enter 1 and 5, you'll get one of 1, 2, 3, 4, or 5.

Footnotes

  1. The If command compares two values (usually numbers) using a condition. If the comparison makes sense, we say it is true, otherwise it is false. For example:

    Value 1 Condition Value 2 Result
    4 is equal to 4 true
    4 is equal to 8 false
    5 is less than 10 true
    5 is greater than 10 false

Follow Us