<< Chapter < Page Chapter >> Page >

Scratch development environment

Image 6 shows a reduced screen shot of the Scratch 2.0 development environment. The text in Image 6 is too small to read in most cases. The main purpose of Image 6 is to show you the overall layout of the Scratch developmentenvironment as it appears in your browser.

Image 6. screen shot of the scratch 2.0 development environment.

Missing image.
Image 6. Screen shot of the Scratch 2.0 development environment.

A sprite-oriented programming environment

Scratch is a sprite-oriented programming environment. Every Scratch project consists of none, one, or more sprites and a stage upon which thesprites perform the behavior for which they are designed.

A sprite is an invisible entity to which the programmer can assign numerous behaviors. Each sprite can have one or more costumes. The assignmentof a visible costume to an invisible sprite causes the sprite to also become visible.

Costumes

The Scratch development environment provides a large gallery of costumes and you can create your own costumes if you don't find any in the gallery that suityour needs. A costume is nothing more than an image. The background in the image is normally transparent. You can import images from a varietyof different file types to create costumes. Probably the most difficult task in creating a costume from an imported image is causing the background tobe transparent (if the image didn't originally have a transparent background) . A built-in paint program is provided to assist in this task. You can alsouse programs such as the free GIMP image editor to deal with the background.

Note that one of the new features in v2.0 is to use both bitmap graphics and vector graphics. I will have more to say about this in a futuremodule.

Walking-boy costumes

The project shown in Image 4 uses five costumes from a family of seven costumes that are available in the gallery. Six of the seven costumes areshown in Image 7 . The project shown in Image 4 uses only the five rightmost costumes shown in Image 7 .

Image 7. costumes for a boy walking.

Missing image.
Image 7. Costumes for a boy walking.

As you can see, the five rightmost costumes describe five stages in a boy walking. The project shown in Image 4 cycles through the five costumes in such a way as to make it appear that the boy is walking. (This process is often called frame animation and dates back to or before the earliest days ofthe Disney productions.)

The stage

The stage is the rectangular area showing the cat in Image 6 . Different images can be assigned to the stage to serve as backgrounds for the performance of thesprites. The gallery contains a large number of background images, and you can also create your own. (One of those backgrounds is shown in Image 6 . ) Usually for a background image, you don't have the transparency issue discussed earlier so backgrounds for the stage can beeasier to create than costumes for sprites.

A moonscape background from the gallery was used for the project shown in Image 4 .

Controlling the behavior of a sprite

You control the behavior of a sprite by writing one or more scripts that belong to the sprite. In reality, each script is an event handler ofsorts. Usually you will have one event handler that executes when the user clicks the green flag at the top right of the stage in Image 6 . (In v2.0, a large green flag button appears when you open a project for viewing in your browser.)

Questions & Answers

what is mutation
Janga Reply
what is a cell
Sifune Reply
how is urine form
Sifune
what is antagonism?
mahase Reply
classification of plants, gymnosperm features.
Linsy Reply
what is the features of gymnosperm
Linsy
how many types of solid did we have
Samuel Reply
what is an ionic bond
Samuel
What is Atoms
Daprince Reply
what is fallopian tube
Merolyn
what is bladder
Merolyn
what's bulbourethral gland
Eduek Reply
urine is formed in the nephron of the renal medulla in the kidney. It starts from filtration, then selective reabsorption and finally secretion
onuoha Reply
State the evolution relation and relevance between endoplasmic reticulum and cytoskeleton as it relates to cell.
Jeremiah
what is heart
Konadu Reply
how is urine formed in human
Konadu
how is urine formed in human
Rahma
what is the diference between a cavity and a canal
Pelagie Reply
what is the causative agent of malaria
Diamond
malaria is caused by an insect called mosquito.
Naomi
Malaria is cause by female anopheles mosquito
Isaac
Malaria is caused by plasmodium Female anopheles mosquitoe is d carrier
Olalekan
a canal is more needed in a root but a cavity is a bad effect
Commander
what are pathogens
Don Reply
In biology, a pathogen (Greek: πάθος pathos "suffering", "passion" and -γενής -genēs "producer of") in the oldest and broadest sense, is anything that can produce disease. A pathogen may also be referred to as an infectious agent, or simply a germ. The term pathogen came into use in the 1880s.[1][2
Zainab
A virus
Commander
Definition of respiration
Muhsin Reply
respiration is the process in which we breath in oxygen and breath out carbon dioxide
Achor
how are lungs work
Commander
where does digestion begins
Achiri Reply
in the mouth
EZEKIEL
what are the functions of follicle stimulating harmones?
Rashima Reply
stimulates the follicle to release the mature ovum into the oviduct
Davonte
what are the functions of Endocrine and pituitary gland
Chinaza
endocrine secrete hormone and regulate body process
Achor
while pituitary gland is an example of endocrine system and it's found in the Brain
Achor
what's biology?
Egbodo Reply
Biology is the study of living organisms, divided into many specialized field that cover their morphology, physiology,anatomy, behaviour,origin and distribution.
Lisah
biology is the study of life.
Alfreda
Biology is the study of how living organisms live and survive in a specific environment
Sifune
Got questions? Join the online conversation and get instant answers!
Jobilize.com Reply

Get Jobilize Job Search Mobile App in your pocket Now!

Get it on Google Play Download on the App Store Now




Source:  OpenStax, Teaching beginners to code. OpenStax CNX. May 27, 2013 Download for free at http://cnx.org/content/col11498/1.20
Google Play and the Google Play logo are trademarks of Google Inc.

Notification Switch

Would you like to follow the 'Teaching beginners to code' conversation and receive update notifications?

Ask