Botball Instructions

The goal is to program a robot that will pick up a ball and place it in a hole. Depending on the arena, you may have one ball, one hole, or several balls/holes. Each arena will need a different code to do well. Once you have programmed a robot that can successfully accomplish the challenges of a specific level, you can then challenge other robots in Botball Arena. How quickly your robot completes the challenge will determine its ranking. You will also be able to sell your robots once they have completed a challenge.

To program a robot:

First go to the Robot Workshop. Enter a name for your robot and level of difficulty. If this is your first time in the workshop, we suggest you try the basic bot until you are more familiar with the game.

When you enter the Robot Workshop, a white command box will pop up. This is where you'll be entering your Javascript code to control the bot!

Basic Commands
go(): moves the bot forward
left(): turns the bot left
right(): turns the bot right
back(): moves the bot in reverse
stop(): stops all of the bot's movements

Global Variables / Constants ( For more advanced robot creation )
ticks: a global variable indicating the time that has passed since the game started (measured in milliseconds. 1000 milliseconds = 1 second)
orange: a constant representing a ball
black: a constant representing a hole

You can enter in the commands manually from the above list or hit the gray command buttons on the side. When you click on a command button, code is entered into the chat box. If you want to add the command code to your robot program - copy and paste from chat box to code box. By using the above commands and the ticks variable to time your movements you can program your bot to go directly for the ball and take it to a hole. Below are some more advanced commands that can be used in conjunction with the ticks variable as well as the 3 constants to program smarter robots.

Sample Code Using Basic Commands
                                          /* Description of commands */
if( ticks == 0 )
{
      go();                         /* <- at 0 milliseconds into the program your bot will do this, basically the first thing it'll do, move forward */
}
if( ticks == 3000 )
{
      right();                         /* <- at 3000 milliseconds into the program your bot will do this, start to turn RIGHT while still moving forward */
}
if( ticks == 5000 )
{
      stop();                         /* <- at 5000 milliseconds into the program your bot will do this, stop all actions then start moving forward */
      go();
}
if( ticks == 8000 )
{
      left();                         /* <- at 8000 milliseconds into the program your bot will do this, start to turn LEFT while still moving forward */
}
if( ticks == 10000 )
{
      stop();                         /* <- at 10000 milliseconds into the program your bot will do this, stop all actions then start moving forward */
      go();
}

Advanced Commands
move(x): parameter x can be between -1 and 1 where -1 moves the bot in reverse at full speed and 1 moves the bot forward at full speed.
turn(x): parameter x can be between -1 and 1 where -1 turns the bot left at full speed and 1 turns the bot right at full speed.
scan(color): the color parameter can be either orange, or black. This function scans for the object and returns the angle between -15 degrees to 15 degrees where 0 degrees is where the bot is facing.
range(): returns the range from the bot to the object in the last call to scan()
bump(): returns a boolean (true/false) value indicating whether the bot is holding a ball.

HINT: Click on the grey command button, "RUN" to test your code.

When finished, save your program.

To compete with a robot:

Once you have successfully saved and created a program for your robot, you can then challenge other robots, and sell your robot in the Robot Hall of Fame.

There are several ways to challenge other robots.
1.Go to an arena and choose to:

2. Click on one of the top 10 robots in the Hall of Fame to challenge them.

3. Click on someone's bot in their City Records! Have fun!