Step 1: Coding keyboard inputs to move the Chicken
This Chicken wants to cross the road but doesn't know how. We need to help our Chicken by telling it how to move.
> Start by clicking on the Play button to test the game. Then click the Level 1 button and try moving the chicken with your keyboard arrow keys.
Nothing happens, right? That's because we need to code keyboard controls (inputs) into our game first.
> Click the Close button to return to the editor.
To get you started we've added a small script for you to edit and build upon.
> Right-click on the Chicken and select Edit Script from the menu.
Do you see that piece of code in the work space, "When created, add tag chicken on myself"?
That block combination is vital for coding controls because is allow the game to identify the Chicken. We need to leave them where they are for now.
Let's start by telling our Chicken how to go Right.
> Click on Events and drag a "When backspace/delete pressed" block into the work space.
> Click on "backspace/delete" and change it to "right arrow".
> Click on Scratch Blocks and drag the "move 10 steps" block into the "When right arrow pressed" block.
> Click on the number "10" and change it to "1".
Your script should now look like this:
> Click Play to test your game.
> Select Level 1 and try pressing the Right arrow key.
If our Chicken moves to the Right then you can now use your right arrow key to win the level.
Continue to the next step.
Otherwise, have a look back over your Script and see if you can spot the bugs.