Now that I have touched base on the basic scratch terminology I can show you how to start coding your sprites to move, think, and talk! When you start a new project on scratch there will only be one sprite loaded in and it will be a waving cat known as Scratch Cat.
Once the project has loaded you can go to one of the three tabs on the top left of your screen labeled Code, Costumes, and Sounds. Those tabs are where the magic happens in Code you insert blocks of code and connect them to a Green flag block. In the costume tab you design costumes fro your sprites as well as your backgrounds. Finally we have the Sound tab where we can add sounds to anything a sprite does to make the game more entertaining.
Now that you know these basics we can get started on coding some movement scripts. First of all you want to start by dragging a Flag Block from the left hand side of your screen, next you should drag out a block that says forever because without this block the code will only repeat once and the game will not function.
After which we will add 4 blocks that say “if ___ then” on them with a big hole in the middle. If I were to fill the blank with another block then I could put command blocks inside the “if___ then” block to tell the sprite how to react.
Once we added the “If___ then blocks” we will put in an” key right arrow pressed?” inside the first “If____ then block.” And for the second block we put in a “key left arrow pressed?” For the third block we put in “key down arrow pressed?” Finally in the fourth “If____ then block” we will add “key up arrow pressed?”
For the next step we will get a “change x by 10 block” into our “If____ then block” by simply dragging it into the correct block. “The change x by 10” goes in block number one. The change x by -10 goes in block two. The change y by -10 goes in block three. Lastly The change y by 10 goes in block 4.
Now if you did all the steps correctly the game should be flowing smoothly. Thanks for sticking to the end of this blog entry and stay posted for another one in 2 weeks!!!