BASIC 4 1st TERM_CODING_NOTES
BASIC 4 1st TERM_CODING_NOTES
Week 1: Revision
Scratch is a visual programming language that allows students to create their own
interactive stories, games and animations. As students design Scratch projects, they
learn to think creatively, reason systematically, and work collaboratively.
SCRATCH INTERFACE
The Scratch user interface is the area on your screen where the Scratch program exists.
The screen is divided into multiple sections or "panes" which have different functions
Ribbon Start/run button Stop button
from picking blocks to code with, to coding, to seeing your code in action.
Stage
Sprite
Sprite
Settings
Backdrop
Library
Code Sprite
Block Library
Palette Script
SCRATCH ELEMENTS
There are four main elements of Scratch: the stage, the sprites, the script and the
programming palette. These elements can be compared to a play.
1) Stage – This is similar to the stage in a play. The stage is where everything will take
place. The stage can be different backgrounds, just like in a play.
2) Sprites – These are the actors or main characters of the project. Sprites are
programmed to do something in Scratch.
3) Script – This tells the actors what to say or do. Each sprite is programmed with a
script.
4) Programming palette – These are elements used to program the sprite to do or say
something. Sprites must be programmed to carry out every function you want them to
perform. \
WEEK 4
click on the “file” icon on the top left corner of the Scratch editor. Select the “save to
your computer” option from the drop-down menu. This will save your file to your
computer.
Click 'File', then from the dropdown menu, click 'load from Your Computer'. Select the
correct file, then click 'Open'. The project will then load onto the Scratch Editor.
Class Exercise1- Choose a Sprite with an appropriate background and save in your
computer
Class Exercise2- Open the scratch application and load your saved project from your
computer
WEEK 5:
The “go to random position” enables the sprite to move to a chosen option from the
drop-down menu. There are two options you can choose from the drop-down menu in
this block, random positions, and mouse pointer.
The glide blocks in Scratch can be used to move a sprite across the Stage. A sprite can
glide to a specific point (coordinates), a random postion , the mouse pointer , or to
another sprite.
Scratch uses x and y coordinate numbers to indicate locations on the Stage. The x
coordinate gives the left–right position, and the y coordinate gives the up–down
position. The coodinate of the centre of the Stage is (x=0, y=0).
Learning objectives:
Class Exercise: Bring out 5 glide blocks and make your sprite move from its current x
and y position to 5 different set positions.
WEEK 7
Midterm Break
WEEK 8
Say blocks can be used to represent speech by sprites. This block displays a specific
speech block in the speech bubble which appears on the screen for a specified
amount of time. The thought blocks represent the sprite’s thoughts as text within the
thought bubble for a specified amount of time.
The “green flag” button is used to run a script in Scratch programming. The button is
located just above the stage area, next to the “red button”. The “red button” is used to
stop the script. To run the script by clicking on the “green flag ” button, you have to
add the code block from the “Events” category.
Class activity- Drag out three or five “say hello for 2secs” blocks, edit each block to
make the sprite introduce itself or tell a story.
WEEK 9
A sprite costume is used to change the reaction of a sprite. This block comes in very
handy to denote the motion of a sprite, such as a bird flapping its wings, where each
costume can be defined as a stage of motion in the bird’s flight.
Choose a sprite.
Class activity: Choose a sprite and an appropriate backdrop, switch sprite to different
costumes with “wait 1 secs” in between each block.
WEEK 10
Class activity: Drag out 5 different “switch backdrop” blocks and make your sprite
communicate in each backdrop switch.
WEEK 11
Revision/Examination