Time for action – adding the left and right arrow controls
Moving the paddle with the mouse works, but users on a laptop may find their built-in mouse difficult to use. Let's revise the paddle script to use the left and right arrows to control movement by following the given steps:
Select the paddle sprite from the sprite list.
From the Control palette, add the when key pressed block to the scripts area.
Change the value to left arrow.
From the Motion palette, attach the move () steps block to the when left arrow key pressed block.
Change the value to -10 (negative 10).
Repeat steps 4 and 5, but use the right arrow key to move 10 steps.
Play the game, and use the arrow keys to move the paddle. The paddle appears to move slowly across the screen.
Let's try to take bigger steps. Change the number of steps to a larger number, such as 50.
Clean up the script by removing the original when flag clicked block that used the mouse x value to control the movement. From the Motion palette, uncheck the x position...