Tag: Scratch

N45 – Scratch

Today we covered

  • Sequence
    • The order that the command are executed in the program
  • Stage
    • The part of scratch where all sprites are displayed (Screen)
  • Sprite
    • This is an object  in scratch which contains instructions (Script)
  • Script
    • An ordered list of command blocks which controls the actions of the sprite.

The class used Scratch to create a program animating a knock knock joke, please look inside the program for further help. The class made use of the Cornell Notes system to record the lesson. For homework the class have to write down the sequence of instructions used (program)

Scratch – Calculations using a loop

Today we recapped performing calculation within and using a loop. We started off redoing the 6 times table task, before improving it to display all the times tables from 1 to 10.

TimesTable

We then created a program that took in 4 ages and displayed the total only using one user created variable

Age

These two programs make use of loops to reduce the number of programming lines, this making the program more efficient.

 

S3 – Conditional Loops

A conditional loop is used to repeat part of the program until a condition is true.

The program shown here is a password checker. The program will exit the loop if the user guess is 1233 or the user has had 3 attempts. This uses a  complex conditional  statement with the logical operator OR, the OR logical operator returns a true value when one of the conditions are true.

The final IF statement checks if the user has entered the correct password before saying welcome.

Creating an Advent Calender in Scratch

It is fairly easy and quick in scratch to create an advent calender.

  • Add the design to the stage background.
  • Add sprite that has the number of the door on it.
  • Add an extra costume to the sprite that will be the gift.
  • Add a script to switch costume when the sprite is clicked.

If it’s so easy then why do I have a video on it? Watch and see after the jump

Read more

It’s a snake!

Today’s task was create a game like Snake. The snake would draw a line as it moved around the screen. Objects to be collected would appear at random places. If the snake touched it’s tail it would lose a life.

We broke down this task as a class into the following manageable pieces.

  1. Move the snake (like the etch-a-sketch program)
  2. Detect if you touch its tail (Maze program)
  3. Display objects and keep score (Maze program)

There are lots of solutions, so give it a shot.