![]() ![]() The first one will control what happens when you press one key on your keyboard. These hat blocks will trigger the stacking blocks you add underneath. These hat blocks trigger events based on key presses. There are only two hat blocks in our extension. There are tons of possibilities for creating online games, music, and inventing your own applications with Scratch! Things get even more fun when you add extensions to help you connect to real world things! If you have LEGO Mindstorms or a Micro:bit, you can add those extensions too! All of your extensions will show up underneath the "My Blocks" palette. The hat blocks trigger the stacking blocks which instruct the sprites in your project how to behave. Scratch works by connecting stacking blocks to hat blocks. There are lots of ways to code key presses, but it's really quick and easy to add the Makey Makey extension so you know when you are coding with a hat block that will work with your Makey Makey!Ī hat block starts a script- think of it as a way to trigger something to happen in your project. You can tell a story, make an animation, or code a poster in your room to speak! If you want to do something we don't cover in this lesson, head over to the great Scratch tutorials to help you get started creating stories, animations, and sound effects. Then spend some time looking over the rest of this lesson and create your own Scratch project. We can't wait to see your projects play out! Watch our Coding Makey Makey Key presses video to create alongside Colleen. Snap the stacking block under the hat block and now you can make Scratch cat move when you click on it. Head to the "Events" palette and try dragging a "When this sprite clicked" block to your work area. ![]() It will make Scratch cat move, but to have this happen when you press a key press, you'll want to use a hat block to trigger the event. Try dragging the "move 10 steps" block to the work area and then click on it. You can drag a block to the center and then click on it to see what happens to the sprite on the right side. To make your sprite (that's what we call a character in your game) do something, you will drag coding blocks to your work area in the center. It has code blocks on the left, each grouped by color in palettes for the different things you will want to use to control your sprites: motion, looks, sound, events, control, sensing, operators, variables, and my blocks (where you can create your own blocks.) If it is your first time to look at Scratch, take a moment to look at how everything is laid out. Scratch was created at MIT and both of our inventors (Jay and Eric) were actually on the Scratch team! Scratch is a free online coding playground where you can create your own stories, games, and animations with coding blocks. The rest of this class will focus on specific areas of Scratch to help you learn how to create your own game with ease! Try following along with the video to code key presses in Scratch. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |