Scratch Tutorial 2: Motion category and Events category blocks
Scratch Tutorial 2 - Motion and Events category blocks
As I said before, Scratch is not on Repl.it, but is cool nonetheless.
I hope this tutorial is brief but explains things good because I tried to make it short for my sake and yours too.
This tutorial will cover Motion category and Events category blocks.
In the following tutorials, "default" will mean what the block looks like in the pallete (before changing block's inputs.)
Some information was retrieved from the Scratch Wiki.
Words and phrases like
this will appear in the glossary at the bottom
C# Dash Tutorials
- Level 1 - Object Oriented Madness
- Level 2 - Math on Track
- Level 3 - Conditionalgeist
- Level 4 - Dry Methods
So let's get started!
Motion category blocks
These are all the
blocks. If it's hard to read, you may want to zoom in.
These blocks will move the selected sprite based on what you chose. When you are editing the backdrop, you can't chose a motion block for obvious reasons.
Move _ steps
This block moves the sprite how much
steps you chose in the direction the sprite is facing. The default amount of steps is 10.
Turn _ degrees
These blocks turns the sprite and where it's facing for the amount of degrees you choose. The default number is 15 and you can choose different blocks for whether it will turn clockwise or counterclockwise.
Go to random position\mouse-pointer
This block will make the sprite go to a random position or the mouse-pointer depending on what you chose. The default is random position.
Go to x: y:
This block will make the selected sprite move to the x and y coordinate position you select. The default is the current position of the selected sprite.
Glide _ secs to random position\mouse-pointer
This will make the sprite move over the course of the selected number of seconds to a random position or the mouse-pointer. The defaults are:
- seconds (secs): 1
- selection: random position
Glide secs to x: y: _
This block will make the sprite move over the course of the selected number of seconds to the selected x and y coordinates. The defaults are;
- seconds (secs): 1
- x and y coordinates: current position of selected sprite.
Point in direction _
This block will make the selected sprite point in whatever direction you chose. The default is 90.
Point towards mouse-pointer
This block will make the sprite point towards the mouse-pointer.
Change x by _
This block will change the sprite's position on the x axis by a certain amount. The default is 10.
Set x to _
This block will set the position of the sprite on the x axis. The default is the sprite's current x position.
Change y by _
This block will change the sprite's position on the y axis by a certain amount. The default is 10.
Set y to _
This block will set the position of the sprite on the y axis. The default is the sprite's current y position.
If on edge, bounce
This block will make the sprite move in the opposite direction if it is touching the edge of the
Set rotation style left-right/don't rotate/all around
This block will set how the sprite rotates. Left-right will make the sprite face only left or right. Don't rotate means the sprite will always face 90°. If you select all around, however, the sprite can rotate 360°. If that doesn't make a lot of sense, then sorry. Click here to go to the Scratch Wiki version which can probably explain this a whole lot better
Reporter blocks: x position, y position, direction
These blocks cannot be used as regular blocks (sticking them together and stuff,) but they can be used inside some operators like < , > , and = (explained in future tutorials.)
Events category blocks
These blocks will be related to
events. Here is the list of blocks.
Most of them start off a script, or a bunch of blocks connected together to make something happen. This is what each of them does.
When green flag clicked
This block will make something happen when the green flag is clicked.
Don't forget that clicking or tapping the green flag is how you run your project
When _ key pressed
The code under this block will run when the key selected is pressed. The default is the space key.
When this sprite clicked
The code below will run when the selected sprite is clicked.
When backdrop switches to ___
The code below will run when the backdrop switches to what you choose. The default is the backdrop that's listed first in the Backdrop menu.
When loudness\timer > _
The code below will run when the loudness or timer (time since project was loaded or reset) is greater than the set value. The defaults are:
- type of value: loudness
- numerical value being compared: 10
When I receive ___
The code below this block will run when either the broadcast ___, or the broadcast ___ and wait blocks are run. The default is whatever
message/broadcast comes first in the order of message/broadcasts.
Broadcast ___ and broadcast ___ and wait
These blocks will run the code under the when I receive blocks. The default is the whatever message/broadcast comes first in the order of message/broadcasts.
If you select the broadcast ___ and wait block, then the next block will not run until every script with a when I receive ___ block is finished running
AND THAT'S IT FOR NOW!!!!!!!!
Stay tuned for Tutorial 3: Looks category and Sound category blocks.
Motion- A category of block that makes a sprite move in some way.
BlockThey are the code that mostly make up scratch projects.
Step- A unit of distance that sprites can move.
Stage- The output part of the project
Event- A category of block that is based on events happening.
Message/broadcastThese are activated by broadcast blocks and the code is made of when I receive blocks.