Activity 5 a little scratch and squeak

10
Activity 5: A little scratch and squeak! Update: 1 Date: 22/08/2012 Facebook Group Page:http://www.facebook.com/groups/KritiRechargeSummerSchool2012/ Facebook Group email: [email protected] Approximate Minimum Time: 1 hour Image from Google Images Image from Google Images Image from Google Images Why do it? Squeak is an open source programming language (http://en.wikipedia.org/wiki/Squeak ). This is a dialect of Smalltalk and is used as a first programing language. It has been developed along the way by Apple and Disney Studios and is used on the One Lap Top for Children project (http://en.wikipedia.org/wiki/One_Laptop_Per_Child ). As a first programming language it is written to be easily understood and debug. Squeak is a language which other applications such as scratch have been written in to allow games for instance to be written easily! We will in this activity use an application of squeak called Scratch. It is a bit like Logo but more sophisticated a good start to programming! How do I know I've succeeded? By the end of this activity you will have a copy of Scratch installed on your computer. This is the basis to be able to start activities 6 though to 10 which will address some of the basic uses of scratch and squeak and start a project! Resources needed: Internet Access A good virus checker and permission to download scratch © Philip Spalding as KritiRechage2012 Summer School LinkedIn: http://uk.linkedin.com/in/philipspalding66 1

description

A basic introduction to squeak a programming language.

Transcript of Activity 5 a little scratch and squeak

Page 1: Activity 5 a little scratch and squeak

Activity 5: A little scratch and squeak!Update: 1

Date: 22/08/2012

Facebook Group Page:http://www.facebook.com/groups/KritiRechargeSummerSchool2012/ Facebook Group email: [email protected]

Approximate Minimum Time:

1 hour

Image from Google Images Image from Google Images Image from Google Images

Why do it?

Squeak is an open source programming language (http://en.wikipedia.org/wiki/Squeak ). This is a

dialect of Smalltalk and is used as a first programing language. It has been developed along the

way by Apple and Disney Studios and is used on the One Lap Top for Children project

(http://en.wikipedia.org/wiki/One_Laptop_Per_Child ). As a first programming language it is

written to be easily understood and debug. Squeak is a language which other applications such as

scratch have been written in to allow games for instance to be written easily! We will in this

activity use an application of squeak called Scratch. It is a bit like Logo but more sophisticated a

good start to programming!

How do I know I've succeeded?

By the end of this activity you will have a copy of Scratch installed on your computer. This is the

basis to be able to start activities 6 though to 10 which will address some of the basic uses of

scratch and squeak and start a project!

Resources needed:

• Internet Access

• A good virus checker and permission to download scratch

© Philip Spalding as KritiRechage2012 Summer School LinkedIn: http://uk.linkedin.com/in/philipspalding66 1

Page 2: Activity 5 a little scratch and squeak

Useful resources

The Scratch Website from Massachusettes Institute of Technology http://scratch.mit.edu/

Skills gained:

• Downloading and installing the application Scratch

• Able to programme movements of an object on a screen

Image from Google Images Image from Google Images Image from Google Images

On the Starting Block: Skills you will already have or need to complete the Activity

Links

Basic Web Browser Navigation Skills

© Philip Spalding as KritiRechage2012 Summer School LinkedIn: http://uk.linkedin.com/in/philipspalding66 2

Page 3: Activity 5 a little scratch and squeak

And we are off! Notes

Step 1: Locating Scratch

We need first to locate the software for Scratch. Type in the URL http://scratch.mit.edu/ into your Web Browser

Step 2: Scratch front Page

You should see the following Screen

© Philip Spalding as KritiRechage2012 Summer School LinkedIn: http://uk.linkedin.com/in/philipspalding66 3

Page 4: Activity 5 a little scratch and squeak

Step 3: Downloading Scratch

To download the Installer and programme click on the beige button to download scratch this should then have the next screen

Select the appropriate download, Scratch for Windows

Click on Run and Follow the instructions from the Windows menus

© Philip Spalding as KritiRechage2012 Summer School LinkedIn: http://uk.linkedin.com/in/philipspalding66 4

Page 5: Activity 5 a little scratch and squeak

Step 4: The Scratch environment

The programme should have installed and placed an icon you desktop in the form of a cat. You should see a screen like this!

The workscreen is divided into three main areas vertically.

1. On the left hand side are the programming modules.

2. In the middle is the script area where instructions from the module area are dragged and dropped in the order they will run

3. On the right side is the outcome window of the scripts where the object you have have chosen follows the instructions from the script sequence you have written. The scripts are all written as modules in Squeak.

© Philip Spalding as KritiRechage2012 Summer School LinkedIn: http://uk.linkedin.com/in/philipspalding66 5

Page 6: Activity 5 a little scratch and squeak

Step 5: A simple sequence

Click on the top left to change the modules from motion to control.

Drag the module “when clicked” across to the script area, connect the repeat instruction below, scroll down on the left hand side to find the stop script module and add this to the end to stop the flow of the script when the repeated instructions end.

© Philip Spalding as KritiRechage2012 Summer School LinkedIn: http://uk.linkedin.com/in/philipspalding66 6

Page 7: Activity 5 a little scratch and squeak

Step 6: Moving objects

We now have a control structure in place. This is will allow us to place instructions within the repeat module.

First select the blue or motion modules by clicking on the top left hand side of the screen.

We are going to cause the object or sprite to move around the screen bouncing of the edge if necessary. To this we drop and drag motion modules or instructions into the repeat module. The first one to select is if on edge bounce.

© Philip Spalding as KritiRechage2012 Summer School LinkedIn: http://uk.linkedin.com/in/philipspalding66 7

Page 8: Activity 5 a little scratch and squeak

Step 7: Moving a Sprite

To make the spite move and turn add the move steps instructions changing the number to 30, then the rotate 15 degrees.

To preview the programme click on the green arrow. The red circle can be used to stop the programme flow. It can viewed also in presentation mode by clicking on the icon in the top right of the screen this produces a larger screen.

Exit this screen by clicking on the retuen arrow on the left hand side of the screen.

© Philip Spalding as KritiRechage2012 Summer School LinkedIn: http://uk.linkedin.com/in/philipspalding66 8

Page 9: Activity 5 a little scratch and squeak

Image from Google Images Image from Google Images Image from Google Images

The finishing Line: How have I Succeeded?

Self Check

Use the tick box grid below to assess your knowledge. Check on National Curriculum, European

Computer Driving Licence and Industry Qualifications section to gauge your progress.

Loaded Scratch Familiar with idea of scripts

Able to write a short program

Execute program and view in presentation mode

Taking it further: The next Steps Activity

Have a look at the games and applications that have been produced by others on

the front page of Scratch http://scratch.mit.edu/. I selected Cannonball as

example (this may require Java to be installed but this is a safe programme),

there is an option to see the script to work out how it was written.

© Philip Spalding as KritiRechage2012 Summer School LinkedIn: http://uk.linkedin.com/in/philipspalding66 9

Page 10: Activity 5 a little scratch and squeak

Notes: For own use

© Philip Spalding as KritiRechage2012 Summer School LinkedIn: http://uk.linkedin.com/in/philipspalding66 10