Scratch Programming - Resources - Interface - Scripts - Programming of Sprites Notes.

What is Scratch?

It is a coding program where blocks are used for the code. The blocks look like pieces of Lego, but the difference being the blocks are on a computer and are built from the top down and not from the bottom up as in lego.

The interface, showing the main operative areas. For the larger sized image, click on the image below.

Click on the image for the 'bigger picture'!

At the top centre above the Scripts/Costumes/Sounds tabs there are also four tab icons:

The stamp - copy, the scissors = cut, the next two are grow and shrink, the last one is help.

In the File menu there also is an option to Record a one minute Video Project. You could also use a screen movie capture program such as Camtasia to record longer videos. However you need a quiet space to do this otherwise you will also capture sounds in the room you are using.

The coding is all contained within the Sprite.

You can also copy the Sprite's coding from one Sprite to another. This would happen when the code is exactly the same over another, or several Sprites.

It is also used when there are minor code changes between Sprites.

To copy the code:

First you need to create a costume for a new Sprite.

Then using the Sprite to copy from - open that Sprite and drag each code hat block to hover over the new Sprite. Once all dragged over, check all the code hat blocks are there and then you have a copied Sprite.

If there are minor changes to be made, usually in the values, then make the changes and test the Scratch to ensure both Sprites work.

In the Edit menu there is a Turbo option to speed up the Scratch.


Scratch programming notes.
From left to right, in the upper left area of the screen, there is a stage area, featuring the results (i.e., animations, everything either in small or normal size, full-screen also available) and all sprites thumbnails listed in the bottom area. 

The stage uses x and y co-ordinates, with 0,0 being the stage centre. x is the horizontal and y is the vertical.
The stage is 480 pixels wide, and 360 pixels high, x:240 being the far right, x:-240 being the far left, y:180 being the top, and y:-180 being the bottom.

These are the scripting categories and how they operate:



Category

Notes

Category

Notes

Motion

Moves sprites and changes angles and change X and Y values

  

Events

Contains event handlers placed on the top of each group of blocks

Looks

Controls the visuals of the sprite; attach speech or thought bubble, change of background, enlarge or shrink, transparency, shade

Control

Conditional if-else statement, "forever", "repeat", and "stop"

Sound

Plays audio files and programmable sequences

Sensing

Sprites can interact with the surroundings the user has created

Pen

Draw on the portrait by controlling pen width, color, and shade. Allows for turtle graphics.

Operators

Mathematical operators, random number generator, and-or statement that compares sprite positions

Data

Variable and List usage and assignment

More Blocks

Custom procedures (blocks) and external devices control and can import from PicoBoard or Lego WeDo 1.0/2.0

Besides the Scripts tab, there are two additional tabs, the Costumes tab and the Sounds tab.
A script is defined within the Scratch program as one or a set of blocks that begins with a Hat Block. Even a single block can qualify. However, scripts are usually referred to as sets of blocks that consist of at least two blocks.

An expandable bar at the right “?’ is the Help area.

The main Script functions is linked here.

Main Menu for Scratch Exercises - Index Page