To make the cooperative game work, the characters need to move.

Click on the blue android sprite to start.

The player will press the right arrow key to make the sprite move right.

From the Events menu, drag out the When Key Pressed Block and select right arrow from the drop-down menu.

To make the sprite move when the key is pressed, place the Move Ten Steps block from the motion menu under the When Key Press Block.

Press the right arrow to test your code.

The character moves but it looks kind of twitchy.

To make the character move more smoothly, make it repeat moving until the right arrow key is no longer pressed.

From the Control menu, place the Repeat Until Block around the the Move 10 Steps Block.

The character should keep moving until the right arrow key is not pressed.

From the Operators menu, place a Not Operator inside the Repeat Until Block.

Then, from the the Sensing Menu, place a Key Pressed Block inside the Not Operator.

Click the drop down and select right arrow for the key.

Now the code reads, when the right arrow key is pressed keep moving 10 steps until the right arrow key is not pressed anymore.

Test the code by pressing the right arrow.

The android moves more smoothly now.

To catch objects in the game the android needs to move left as well.

The code that makes the android move left is almost the same as what you just created to make it move right.

So you can copy the code to save yourself time and effort.

To copy your code, right click on the top of the code stack and click duplicate.

A new identical block stack should appear.

Next, change the names of the key in the new stack.

Click the drop down on the When Key Pressed Block and change it from right arrow to left arrow.

Do the same for right arrow in the condition.

Finally, make the character move left instead of right by changing the 10 in the Move 10 Steps Block, to a negative 10.

Test your code.

When you press the right arrow, the character should move right, and when you press the left arrow, it should move left.


The other character in the game needs to move as well.

You will program the yellow android the same way you programmed the blue one.

Drag both stacks of code from the blue android to the yellow android in the sprite's area.

Click on the yellow android.

It should now have the same code as the blue android, but you and your friend can't use the same keys to play.

Typically, when two players are using the same keyboard one uses the arrows, and the other uses the W, A, S, and D keys because they have a similar configuration to the arrow keys but are located on the other side of the keyboard.

Click on the drop downs to change left arrow to A, and right arrow to D on the Event and Sensing Blocks.

Test by pressing the A and D keys.

The yellow android moves left and right.

Nice job.

Now it's your turn.

Program the blue android to move right and left using When Key Pressed, Move, Key Press, Not, and Repeat Until Blocks.

Copy both stacks of code to the other character's sprite and make it move when the A and D keys are pressed.


  1. Program the blue android to move right and left using "when key pressed," "move," "key pressed," "not," and "repeat until" blocks.
  2. Copy both stacks of code to the other character sprite, and make it move when the "a" and "d" keys are pressed.