Free Scratch Starter Guide
A step-by-step guide to creating your first Scratch game. Follow along block-by-block to build a playable character controller and collect coins!
A step-by-step guide to creating your first Scratch game. Follow along block-by-block to build a playable character controller and collect coins!
The backdrop, player sprite and movement script are already set up. Open it in Scratch, then follow the steps below to make it your own.
To open it: in Scratch, click File then Load from your computer and pick scratch-starter.sb3.
We'll rename and resize the default cat sprite to be our player.
Sprite1 to Player.80% (or whatever looks good).x: 0, y: -100 (near the bottom of the stage).Coin and set its size to 60%.x: 150, y: 50.Click the Player sprite, then go to the Code tab. Drag blocks from the left panel to build this script:
-- PLAYER MOVEMENT -- when green flag clicked go to x: (0) y: (-100) forever if key left arrow pressed? then change x by (-5) if key right arrow pressed? then change x by (5) if key up arrow pressed? then change y by (5) if key down arrow pressed? then change y by (-5)
How to build this: From the Events category, drag when green flag clicked. From Control, drag forever. Inside the loop, nest four if-then blocks. For each, use a Sensing key pressed? block inside the hexagonal slot. Add Motion change x/y by blocks inside each if.
score, choose For all sprites, and click OK.Add this script to the Player sprite (a separate script block):
-- SCORE RESET -- when green flag clicked set [score] to (0)
Click on the Coin sprite and add this script:
-- COIN COLLECTION -- when green flag clicked forever if touching Player? then change [score] by (1) go to x: pick random (-200) to (200) y: pick random (-150) to (150)
How to build this: Events → when green flag clicked. Control → forever. Inside: if-then with a Sensing touching Player? block. Inside the if: Variables change score by 1, then Motion go to x: y: with two Operators pick random blocks filling the x and y slots.
Ideas to expand:
costume changes to animate the player while moving.Check out our Scratch Block Reference Cheat Sheet for a quick reference of every block category.
๐ Scratch Cheat Sheet โ