# Scratch Challenges ###### tags: `code club` ## Related Documents [Scratch Project Cards](/XLoN8CaXSjWO50PouaEy0g?both) [Code Club Worksheets](/@dethe/r1SGh8SnG?both) [Code Club - Worksheet Goals](/To_SsIyNQ8ioKTPhbHCymQ?both) [Code Club Code Tour](/hrZyAXexQT2LvZVb4UG49Q?both) [Hosting Code Clubs](/GoJ-ekBSSbaTmzjlLQKmcg?both) ## Coding Fundamentals There are four things every programming language needs, and virtually all of them have these in some form or other. How can you do them in Scratch? * `Save` a value in a variable * `Choose` whether to run some code, or which code to run * `Repeat` some code multiple times * `Reuse` code by putting it in a block In order to be truly *useful* a programming language also has to be able to take input from the outside (ask the user a question, read a file) and return output from it's processing (save a file, render an image). What kinds of input and output does Scratch have? What kinds are missing, and why? ## Scratch Challenges - Game Basics * [ ] Build an repeat forever moving a ball sprite around the screen, bouncing off walls. * [ ] Initialize ball in a random direction on green flag clicked * [ ] Create paddles. When ball hits paddle its direction = 0 - direction * [ ] Move left paddle up and down with w and s keys using if blocks in a repeat forever. Do the same with right paddle, but use up and down arrow keys. * [ ] Add a re-serve key (r) to serve the ball again without restarting, in case ball is bouncing between floor and ceiling. * [ ] Add Score variables for each player, initialize them to zero when green flag clicked. * [ ] ## Scratch Challenges - Drawing * [ ] Install the pen extension * [ ] Hide the sprite * [ ] Draw a triangle 60 steps per side * [ ] Draw a square 60 steps per side * [ ] Draw a hexagon 60 steps per side * [ ] Create a function to draw a polygon with n sides and x steps per side ## Scratch Challenges - Storytelling * [ ] Add two sprites and set them facing each other * [ ] Add a background setting and figure out what they are talking about * [ ] Write a short conversation with them using `say [something] for [2] seconds` and `wait [x] seconds` blocks. * [ ] Add something happening in the background: a bird flying a balloon floating past, people walking. * [ ] Add a scene change, one of the characters from first scene is now talking to a new character. Maybe the second character walks up to join the conversation? * [ ] Can you use custom blocks to simplify the overall flow of conversation? * [ ] Can you use broadcast messages to help synchronize different things going on in the story? ## Scratch Challenges - Music * [ ] Add the Music Extension that lets us program notes and rests * [ ] Add some instrument sprites * [ ] Give each instrument a person sprite to play it. * [ ] Give each instrument a `When this sprite clicked` event block, and a `Set instrument to [instrument]` block to set it to the correct type of instrument (i.e., the guitar should sound like a guitar, etc.) * [ ] Add notes for a song * [ ] Camptown races: `F# F# E F# B A B F# E C# E C#` ![](https://i.imgur.com/6i4Ak6T.jpg) ## Scratch Challenges - BBC micro:bit ## Scratch Challenges - Lego WeDo ## Scratch Challenges - Arena Game ## Scratch Challenges - Spacewar Game ## Scratch Challenges -