SlideShare a Scribd company logo
1 of 123
Media Computing
Click the arrow to continue.
X

Contents
REQUIREMENTS:
This e-learning package requires you to:
1. Go through this presentation
2. Try the sample scripts provided.
3. Create a game using this presentation and the sample scripts to help you.
4. Submit your game through LMS.

RESOURCES:
You should have downloaded the attached files. You should have 2 partially
completed games:
- Alien
- Prevent_dengue
X
Use these button for
quick access to each set
of scripts.
Back to the home page.
Click to see more of
each script block.

Quits this presentation

Navigating
Next page

Previous page
X

Select a set of scripts to begin

See Sample scripts

Go to Task
X

Motion
Click on the scripts on the left to see what each script does
to the worm below.
X

Move 10 steps
Click on the scripts on the left to see what each script
does to the worm below.

Moves the sprite 10 steps in the current direction.
X

Turn clockwise
Click on the scripts on the left to see what each script
does to the worm below.

Turns the sprite (X) degrees clockwise.
X

Turn Anti-clockwise
Click on the scripts on the left to see what each script
does to the worm below.

Turns the sprite (x) degrees anti clockwise.
X

Point in direction: – 0o
Mouse over the different degrees to see what happens
0o

90o

-90o

180o
Points the sprit in a specified direction.
X

Point in direction: 180o
Mouse over the different degrees to see what happens
0o

90o

-90o

180o
Points the sprit in a specified direction.
X

Point in direction: -90o
Mouse over the different degrees to see what happens
0o

90o

-90o

180o
Points the sprit in a specified direction.
X

Point in direction : 90o
Mouse over the different degrees to see what happens
0o

90o

-90o

180o
Points the sprit in a specified direction.
X

Point towards:
Mouse over the different degrees to see what happens

Points the sprit in a specified direction.
X

Go to X: Y:
Instantly moves a sprite to a specified coordinate position.
X: 180
X: 150

Y: -200

Y: 200

Y: -150
Centre of the
stage is always
(0, 0)
X: -180

Go to X: 150 Y: -150
X

Go to (XX):
Instantly moves the sprite the location of another sprite or
mouse pointer.

Go to <Mouse pointer> Sprite goes to wherever the
mouse pointer goes
X

Glide ( )secs to X: Y:
Gradually moves the sprite to a specified position over a
number of seconds.
Y: 180

X: 100
X: 200

X: -200
Y: -50

Y: -180
Glide (3) secs to to X: 100 Y: -50
X

Change x by ( )
Moves the sprite left or right regardless of direction the
sprite is pointing.

Click the buttons belowt o compare the effect of the 3
different scripts.
Change x by (20)

Change x by (-20)

Move (20) steps
X

Change x by ( 20 )
Moves the sprite left or right regardless of direction the
sprite is pointing.

Click the buttons belowt o compare the effect of the 3
different scripts.
Change x by (20)

Change x by (-20)

Move (20) steps
X

Change x by ( -20 )
Moves the sprite left or right regardless of direction the
sprite is pointing.

Click the buttons belowt o compare the effect of the 3
different scripts.
Change x by (20)

Change x by (-20)

Move (20) steps
X

Move ( 20 ) steps
Moves the sprite left or right regardless of direction the
sprite is pointing.

Click the buttons belowt o compare the effect of the 3
different scripts.
Change x by (20)

Change x by (-20)

Move (20) steps
X

Move ( 20 ) steps
Moves the sprite left or right regardless of direction the
sprite is pointing.

Click the buttons below to compare the effect of the 3
different scripts.
Change y by (20)

Change y by (-20)

Move (20) steps
X

Change y by ( )
Moves the sprite up or down regardless of direction the
sprite is pointing.

Click the buttons below to compare the effect of the 3
different scripts.
Change y by (20)

Change y by (-20)

Move (20) steps
X

Change y by ( 20 )
Moves the sprite left or right regardless of direction the
sprite is pointing.

Click the buttons below to compare the effect of the 3
different scripts.
Change y by (20)

Change y by (-20)

Move (20) steps
X

Change y by ( -20 )
Moves the sprite left or right regardless of direction the
sprite is pointing.

Click the buttons below to compare the effect of the 3
different scripts.
Change y by (20)

Change y by (-20)

Move (20) steps
X

If on edge, bounce
Usually used when the sprite is moving. When the sprite touches
the edge of the screen, it will “bounce” and move in the opposite
direction.

Mouse over the button below to see an example.
Start
X

If on edge, bounce
Usually used when the sprite is moving. When the sprite touches
the edge of the screen, it will “bounce” and move in the opposite
direction.

Mouse over the button below to see an example.
Start
X

Looks
Click on the scripts on the left to see what each script does
to the worm below.
X

Switch costume
Switch to costume ( )

Next costume

Allows you to choose which
costume to switch to.

Automatically switches to the
next costume.

back
X

Switch costume
Lets say the worm below has 3 costume.
Costume 1

Costume 1

Click the commands below to see what
happens to the worm.
Switch to costume (costume 1)

Costume 2

Switch to costume (costume 2)
Switch to costume (costume 3)
Next costume
X

Switch costume
Lets say the worm below has 3 costume.
Costume 1

Costume 1

Click the commands below to see what
happens to the worm.
Switch to costume (costume 1)

Costume 2

Switch to costume (costume 2)
Switch to costume (costume 3)
Next costume
X

Switch costume
Lets say the worm below has 3 costume.
Costume 1

Costume 1

Click the commands below to see what
happens to the worm.
Switch to costume (costume 1)

Costume 2

Switch to costume (costume 2)
Switch to costume (costume 3)
Next costume
X

Switch costume
Lets say the worm below has 3 costume.
Costume 1

Costume 1

Click the commands below to see what
happens to the worm.
Switch to costume (costume 1)

Costume 2

Switch to costume (costume 2)
Switch to costume (costume 3)
Next costume
X

Say
Automatically creates a speech balloon to say a specified
text.

How are You?

Say [ How are you ? ] for (3) secs.
X

Think…
Similar to the “say” script, but creates a thought balloon
instead.
How are you?

Think [ How are you ? ] for (3) secs.
X

Change size by ( )
Changes the size by a specified amount each time the
script is used.

Negative numbers will shrink the sprite
Positive numbers will grow the sprite.

Change size by ( 50)
Size = 150%

Size = 100%
Change size by ( - 50)
Size = 50%
X

Set size to ( )%
Changes the size by a specified amount once only.
Only positive numbers used.
Click
here
and Set Size

to see difference between Change Size

Set size to (150)%
Size = 150%

Size = 100%
Set size to (50) %
Size = 50%
back

X

Change size vs Set size
The difference between change size and set size become obvious
when the same script is used multiple times.
script
Size = 100%

Used 1st time

Used 2nd time

Used 3rd time

Size = 130%

Size = 160%

Size = 190%

Size = 30%

Size = 30%

Size – 30%

Change size
by (30)
Size = 100%

Set size to
(30) %
X

Show and Hide
Show: the sprite can be seen (visible)
Hide: the sprite cannot be seen (invisible)

Show

Hide
X

Show and Hide
Show: the sprite can be seen (visible)
Hide: the sprite cannot be seen (invisible)

Show

Hide
X

Show and Hide
Show: the sprite can be seen (visible)
Hide: the sprite cannot be seen (invisible)

Show

Hide
X

Sounds
This set of scripts allows you to control sounds in your
game or animation.

Click on one of the highlighted scripts to check what they
do.
X

Play sound ( )
Plays a specified sound.

Sound effect must be imported into the sprite library for
you to be able to use them.

Click

Here

to find out how to import sounds
X

Importing sound effects

Click on the SOUNDS
tab to start importing
sound effects.
X

Importing sound effects

Click on the IMPORT
button to select the
sound effect you
need.
X

Importing sound effects

Select the sound that
you need and click OK
back

X

Importing sound effects

Your sound effect is
now imported.
X

Play sound ( ) until done
Plays a specified sound and waits until the sound clip ends
before moving on to the next script.

Sound effect must be imported into the sprite library for
you to be able to use them.

Click

Here

to find out how to import sounds
X

Stop all sounds
Stops all sound effects in the game or animation.

Usually used when the game ends or when a condition is
met.
X

Control
Click on a set of control scripts.
Terminators

Loops and
conditionals

Examples

When key pressed;
When I receive;
When sprite clicked
Stop
Stop all

Examples

If, If.. Then.. Else;
Repeat loops
Forever loops
Broadcast
X

Controls – Terminators
Terminators are used to start or stop a set of scripts.

Click on a terminator to learn more about it.
X

When (green flag) clicked
The green flag is usually used to start the game or
animation.

Click on the green
flag to start
X

When (green flag) clicked
The green flag is usually used to start the game or
animation.

Click on the green
flag to start

Click on another terminator to continue
X

When ( ) key pressed
Key press can also be used to start a game or animation.
Key press is a common method to control characters or
sprites in a game.

Space bar
Click on the
spacebar above
X

When ( ) key pressed
Key press can also be used to start a game or animation.
Key press is a common method to control characters or
sprites in a game.

Space bar
Click on the
spacebar above

Click “spacebar” to change costume again or click
MORE continue.

more
X

Key press as controls

Click on the arrow keys to see
what each key press does to the
worm above

Click on another terminator to
continue.
X

When sprite clicked
The sprite “worm” changes costume when clicked
and changes back after 0.25 seconds.

Try clicking on the worm, or click another terminator to
continue.
X

Loops and Conditionals
LOOPS

A set of scripts that repeats itself.

CONDITIONAL
LOOPS

A set of scripts that repeats itself
until a condition is fulfilled.

CONDITIONALS

An event that must happen to start
a set of scripts.

CONDITIONALS

An event that must happen to start
a set of scripts.
X

Forever Loops
Scripts inside the forever loop will be repeated over and over
again.
Forever Loops can be stopped when the “STOP ALL” command
is used.

Example:
X

Conditional Loops
Select one of the conditional loops below to find out more.

Repeat ( )

Repeat until < >
X

Repeat ( )
Repeats the script inside the loop a fixed number of times.
In the script on the right, the
worm moves 10 steps and
waits for 0.5 seconds for 3
times. , and then changes
costume.
Click here to start
X

Repeat until < >
Repeats the script inside the loop a fixed number of times.
In the script on the right, the
worm moves 10 steps and
waits for 0.5 seconds until it
touches the edge , and then
changes costume.
Click here to start
X

“If” statements
If statements specify an event that must happen before the
scripts in the statement is run..

Select one of the options below to learn more.

IF < > …

IF < > … ELSE …
X

IF < > …
The event specified in < > must happen for the script to run.
The script on the right shows
part of a game.
Click on the larger number to
score a point.
IF you score 3 points, you win.

Click here to start
X

IF < > …
The event specified in < > must happen for the script to run.
The script on the right shows
part of a game.
Click on the larger number to
score a point.
IF you score 3 points, you win.

Click here to start
X

IF < > …
The event specified in < > must happen for the script to run.
The script on the right shows
part of a game.
Click on the larger number to
score a point.
IF you score 3 points, you win.
SCORE

Click here to start
Which number
is larger?

34

OR

45

0
X

IF < > …
The event specified in < > must happen for the script to run.
The script on the right shows
part of a game.
Click on the larger number to
score a point.
IF you score 3 points, you win.
SCORE

Next question
Correct!

1
X

IF < > …
The event specified in < > must happen for the script to run.
The script on the right shows
part of a game.
Click on the larger number to
score a point.
IF you score 3 points, you win.
SCORE
Which number
is larger?

50

OR

32

1
X

IF < > …
The event specified in < > must happen for the script to run.
The script on the right shows
part of a game.
Click on the larger number to
score a point.
IF you score 3 points, you win.
SCORE

Next question
Correct!

2
X

IF < > …
The event specified in < > must happen for the script to run.
The script on the right shows
part of a game.
Click on the larger number to
score a point.
IF you score 3 points, you win.
SCORE
Which number
is larger?

0

OR

-1

2
X

IF < > …
The event specified in < > must happen for the script to run.
The script on the right shows
part of a game.
Click on the larger number to
score a point.
IF you score 3 points, you win.
SCORE

End game
Correct!
YOU WIN !

3
X

IF < > …
The event specified in < > must happen for the script to run.
The script on the right shows
part of a game.
Click on the larger number to
score a point.
IF you score 3 points, you win.

Wrong answer! Please try again.

<< Back
X

IF < >… ELSE …
The event specified in < > must happen for the script to run.
IF < > … ELSE … is used when there are only 2 options. E.g: YES
or NO, TRUE or FALSE, A or B.

Compare the 2 scripts below:

Click each one to see how they work.
X

IF < >… ELSE …
Answer the question
below.
Click the correct
answer.

How many hours are there in a day?

(A) 24 hours

Answer A

(B) 30 hours

Answer B

(C) 78 hours

Answer C
X

IF < >… ELSE …

You Win!

How many hours are there in a day?

(A) 24 hours

Answer A

(B) 30 hours

Answer B

(C) 78 hours

Answer C
X

IF < >… ELSE …

Almost there!

How many hours are there in a day?

(A) 24 hours

Answer A

(B) 30 hours

Answer B

(C) 78 hours

Answer C
X

IF < >… ELSE …

Are you sure?

How many hours are there in a day?

(A) 24 hours

Answer A

(B) 30 hours

Answer B

(C) 78 hours

Answer C
X

IF < >… ELSE …

Answer the question below.
Click the correct answer
How many hours are there in a day?

(A) 24 hours

Answer A

(B) 30 hours

Answer B

(C) 78 hours

Answer C
X

IF < >… ELSE …

You Win!

How many hours are there in a day?

(A) 24 hours

Answer A

(B) 30 hours

Answer B

(C) 78 hours

Answer C
X

IF < >… ELSE …

Wrong Answer!

How many hours are there in a day?

(A) 24 hours

Answer A

(B) 30 hours

Answer B

(C) 78 hours

Answer C
X

IF < >… ELSE …

Wrong Answer!

How many hours are there in a day?

(A) 24 hours

Answer A

(B) 30 hours

Answer B

(C) 78 hours

Answer C
X

BROADCAST and RECEIVE
BROADCAST = Send a message
Start Animation
RECEIVE = receive the message

Sprite 1
Back to controls

Sprite 2
X

BROADCAST and RECEIVE
BROADCAST = Send a message
RECEIVE = receive the message

Change your
So much
Colour!
better!

Sprite 1
Back to controls

Sprite 2
X

BROADCAST and RECEIVE
BROADCAST = Send a message
Restart Animation
RECEIVE = receive the message

So much
better!

Notice this speech
balloon appeared too
early.
Sprite 1
Back to controls

Sprite 2
X

BROADCAST and RECEIVE
BROADCAST = Send a message
RECEIVE = receive the message

Lets change this to
BROADCAST AND WAIT.
So much
better!

Sprite 1
Back to controls

Sprite 2
X

BROADCAST and RECEIVE
BROADCAST = Send a message
Start Animation
RECEIVE = receive the message

Sprite 1
Back to controls

Sprite 2
X

BROADCAST and RECEIVE
BROADCAST = Send a message
RECEIVE = receive the message

Change your
So much
Colour!
better!

Sprite 1
Back to controls

Sprite 2
X

Broadcast vs Broadcast and Wait
• Broadcast:
– Sends the message and continues with the next
script

• Broadcast and wait
– Sends the message, waits for the message to be
received carried out, then continues with the next
script.

Back to controls
X

Sensing
Blocks found under the sensing section are never used
alone, except for Ask and Wait.
Sensing scripts are used together with other scripts,
usually conditional loops and “IF” statements
X

Operators
Operators may be used to specify conditions
They may be used together with sensing blocks control
blocks.
Click on one of the block on the left to continue.
X

Mathematical operators
These are used when mathematical calculation is needed.
X

Random Number Generator
One of the most commonly used script blocks in game
design. Generates a random number when used.
Click next to see examples:
X

Examples
Points the sprite in a random direction between 0 to 360.

Sets the variable (Scene) to either 1 or 2 randomly.

Moves the sprite to a random X-position between -200 and
200.
X

Logical operators
Less than.
Equals to.
Greater than.
Examples of Use:
X

Join [ ] [ ]
Joins 2 words together.
Used together with the “say” script.

Example: Click the 2 scripts below to see what is said.
X

Join [ ] [ ]
Joins 2 words together.
Used together with the “say” script.

Example: Click the 2 scripts below to see what is said.

Your score is 5
X

Join [ ] [ ]
Joins 2 words together.
Used together with the “say” script.

Example: Click the 2 scripts below to see what is said.

Your answer A is correct!
X

Variables
A variable is a memory location set aside to store
data types such as numbers, text or dates. This
location will contain something when it is first
used. Hence, it is important to clear the location
and fill it with the value that you want. The
process of filling with a start value is called
initialisation.
X

Variables
A common variable that we will use frequently is the
score of a game. The score is a variable because it keeps
changing (varying) when the game is being played. We
use the “set” instruction to initialise a variable.

For example, we can set a variable “lives” to a start
value of 5 by using this instruction:
X

Variables
Checking the variable makes that variable visible on
screen.
X

Variables
This instruction can be used to change the value of a
variable.
The instruction below will change the variable “lives” by 1.
X

Sample Scripts
Alien Invasion

Create the scripts for each of the sprite below:
X

Alien invasion
Open the file “Alien”. Create the scripts for each of the sprite below:

Click the sprites to see the scripts
X

Hammer Scripts
Mouse over the scripts to see explanations
X

Hammer Scripts
Mouse over the scripts to see explanations

When the green flag is clicked,
the hammer is reset to the
position X: 0, Y: 122.
Hammer is visible (show).
X

Hammer Scripts
Mouse over the scripts to see explanations

When spacebar is pressed, the
hammer moves as if it is being
swung.
A broadcast message (hit) is sent
to see if the hammer hits the
alien spaceship.
X

Hammer Scripts
Mouse over the scripts to see explanations

When the right arrow key is
pressed, the hammer moves right
by 10 steps
If the x-position of the hammer is
more than 200, it is automatically
changed to 200.
This prevents the hammer from
going off the screen.
X

Hammer Scripts
Mouse over the scripts to see explanations

When the Left arrow key is
pressed, the hammer moves left
by 10 steps
If the x-position of the hammer is
less than -200, it is automatically
changed to 200.
This prevents the hammer from
going off the screen.
X

Alien Spaceship Scripts
Mouse over the scripts to see explanations
X

Alien Spaceship Scripts
Mouse over the scripts to see explanations

Initialisation:
The Alien spaceship is shown,

Lives is reset to 3
Score is reset to 0
Spaceship is moved to a random
x-position at y:128
X

Alien Spaceship Scripts
Mouse over the scripts to see explanations

Until score=5 or lives=0, the
spaceship is moved downwards
every 0.2 sec.

If the spaceship touches green
color (the ground), deduct 1 from
the variable lives.
Resets by appearing in another
random location.
X

Alien Spaceship Scripts
Mouse over the scripts to see explanations

If score = 5, the broadcast a WIN
message,
Otherwise, broadcast a loss
message.
X

Alien Spaceship Scripts
Mouse over the scripts to see explanations

When the broadcast message
“hit” is received, check to see if
spaceship is touching the
hammer.
If touching hammer (sprite 2),
increase the score by 1, hide the
spaceship.
Spaceship reappears at another
random x position at the top of
the screen.
X

Background Scripts
Mouse over the scripts to see explanations
X

Alien Spaceship Scripts
Mouse over the scripts to see explanations

When Green flag is clicked, the
game background is shown.
X

Alien Spaceship Scripts
Mouse over the scripts to see explanations

When the “lose” broadcast
message is received, change
background to shown lose-game
message.
X

Alien Spaceship Scripts
Mouse over the scripts to see explanations

When the “win” broadcast
message is received, change
background to shown win-game
message.
X

Task for submission.
Create a game using scratch as in the video below

Submit your game through Ask n Learn.
X

Game title: Prevent Dengue
STATE the problem
• This game is about killing Aedes mosquitoes to prevent the
spreading of dengue fever.
• The aim is to swing the bat to kill the mosquitoes. The
mosquito starts randomly from the left side of the screen
and moves towards the right.
• If the bat hits the mosquito, the score increases by 1. If the
mosquito is not hit, the number of lives which begins at 3
will decrease by 1.
• The game ends when 5 mosquitoes are killed or the
number of lives equals 0.
X

Game title: Prevent Dengue
X

Game title: Prevent Dengue
THINK about what is needed
1. Refer to the flowchart to program the game.
2.

Plan the code for the background such that it switches to different
scenes depending on the different situations. The three scenes are start
of the game, end of the game when 5 mosquitoes are killed, and end of
the game when number of lives is zero.

3.

Plan the code for the bat such that it can only move up and down within
the screen; and it will swing back and forth when the space key is
pressed (to simulate hitting the mosquito).

4.

Plan the code for the mosquito such that it
a)
b)
c)

appears randomly at the left side of the screen;
moves from left to right; and
tracks the number of mosquitoes and number of lives.
X

Game title: Prevent Dengue
ENGAGE in coding
1. Open a new file and use all the images provided.
2. Create the code for the background and the bat as
planned.
3. Save the file as mosquito_<your name>.
4. Create the code for the mosquito as planned.
5. Save your work.
X

Game title: Prevent Dengue
SUBMIT your code through LMS.
Name your file as “dengue_your_name”
REFINE your code (Challenge)
- You may choose not to attempt this section.
- Add one or two more mosquitos to your
game.
X

The End.

More Related Content

Viewers also liked

Txinako musika
Txinako musikaTxinako musika
Txinako musikairune_97
 
Social Change Model Leadership Debelopment
Social Change Model Leadership DebelopmentSocial Change Model Leadership Debelopment
Social Change Model Leadership DebelopmentBecca Smart
 
гиа спп
гиа сппгиа спп
гиа сппbhtyf1278
 
Muscular system
Muscular systemMuscular system
Muscular systemTANTL
 
Hego amerika
Hego amerika Hego amerika
Hego amerika irune_97
 

Viewers also liked (8)

Txinako musika
Txinako musikaTxinako musika
Txinako musika
 
Img
ImgImg
Img
 
Social Change Model Leadership Debelopment
Social Change Model Leadership DebelopmentSocial Change Model Leadership Debelopment
Social Change Model Leadership Debelopment
 
гиа спп
гиа сппгиа спп
гиа спп
 
Birth control
Birth controlBirth control
Birth control
 
Muscular system
Muscular systemMuscular system
Muscular system
 
Hego amerika
Hego amerika Hego amerika
Hego amerika
 
Muscular System
Muscular SystemMuscular System
Muscular System
 

Similar to Mec e learning2

Scratch Lesson 1 – Basics
Scratch Lesson 1 – BasicsScratch Lesson 1 – Basics
Scratch Lesson 1 – BasicsDavid Oromaner
 
Star logo nova code cookbook
Star logo nova  code cookbookStar logo nova  code cookbook
Star logo nova code cookbookBarbara M. King
 
Star logo nova code cookbook(1)
Star logo nova  code cookbook(1)Star logo nova  code cookbook(1)
Star logo nova code cookbook(1)Barbara M. King
 
Scratch for kids syllabus for 5 hours by bibek pandit
Scratch for kids syllabus for 5 hours by bibek panditScratch for kids syllabus for 5 hours by bibek pandit
Scratch for kids syllabus for 5 hours by bibek panditBibekPandit2
 
Smoke 5 timeline effects
Smoke 5   timeline effectsSmoke 5   timeline effects
Smoke 5 timeline effectsSamuel Edsall
 
Use of MathType software with MSWord
Use of MathType software with MSWordUse of MathType software with MSWord
Use of MathType software with MSWordMadurai
 
Instructions for Scratch Pong Game Adaptation to use with MaKey MaKey
Instructions for Scratch Pong Game Adaptation to use with MaKey MaKeyInstructions for Scratch Pong Game Adaptation to use with MaKey MaKey
Instructions for Scratch Pong Game Adaptation to use with MaKey MaKeyRenee Neumeier
 
9.6 Systems of Inequalities and Linear Programming
9.6 Systems of Inequalities and Linear Programming9.6 Systems of Inequalities and Linear Programming
9.6 Systems of Inequalities and Linear Programmingsmiller5
 
Illustrator cheats small
Illustrator cheats smallIllustrator cheats small
Illustrator cheats smallRavi Jotungiya
 
Sony Vegas Pro Keyboard Shortcuts
Sony Vegas Pro Keyboard ShortcutsSony Vegas Pro Keyboard Shortcuts
Sony Vegas Pro Keyboard ShortcutsRahul Jose
 
We are going to learn to program!
We are going to learn to program!We are going to learn to program!
We are going to learn to program!jenloudun
 
дыдыкин егор
дыдыкин егордыдыкин егор
дыдыкин егорkuchinskaya
 
Final Cut Pro 7 Certification Lesson 5
Final Cut Pro 7 Certification Lesson 5Final Cut Pro 7 Certification Lesson 5
Final Cut Pro 7 Certification Lesson 5Samuel Edsall
 

Similar to Mec e learning2 (17)

Scratch Lesson 1 – Basics
Scratch Lesson 1 – BasicsScratch Lesson 1 – Basics
Scratch Lesson 1 – Basics
 
Star logo nova code cookbook
Star logo nova  code cookbookStar logo nova  code cookbook
Star logo nova code cookbook
 
Star logo nova code cookbook(1)
Star logo nova  code cookbook(1)Star logo nova  code cookbook(1)
Star logo nova code cookbook(1)
 
Scratch for kids syllabus for 5 hours by bibek pandit
Scratch for kids syllabus for 5 hours by bibek panditScratch for kids syllabus for 5 hours by bibek pandit
Scratch for kids syllabus for 5 hours by bibek pandit
 
How do i
How do iHow do i
How do i
 
Smoke 5 timeline effects
Smoke 5   timeline effectsSmoke 5   timeline effects
Smoke 5 timeline effects
 
Use of MathType software with MSWord
Use of MathType software with MSWordUse of MathType software with MSWord
Use of MathType software with MSWord
 
Instructions for Scratch Pong Game Adaptation to use with MaKey MaKey
Instructions for Scratch Pong Game Adaptation to use with MaKey MaKeyInstructions for Scratch Pong Game Adaptation to use with MaKey MaKey
Instructions for Scratch Pong Game Adaptation to use with MaKey MaKey
 
9.6 Systems of Inequalities and Linear Programming
9.6 Systems of Inequalities and Linear Programming9.6 Systems of Inequalities and Linear Programming
9.6 Systems of Inequalities and Linear Programming
 
Illustrator cheats small
Illustrator cheats smallIllustrator cheats small
Illustrator cheats small
 
Sony Vegas Pro Keyboard Shortcuts
Sony Vegas Pro Keyboard ShortcutsSony Vegas Pro Keyboard Shortcuts
Sony Vegas Pro Keyboard Shortcuts
 
Unity 101
Unity 101Unity 101
Unity 101
 
Algorithm
AlgorithmAlgorithm
Algorithm
 
We are going to learn to program!
We are going to learn to program!We are going to learn to program!
We are going to learn to program!
 
дыдыкин егор
дыдыкин егордыдыкин егор
дыдыкин егор
 
Scratch Animation
Scratch AnimationScratch Animation
Scratch Animation
 
Final Cut Pro 7 Certification Lesson 5
Final Cut Pro 7 Certification Lesson 5Final Cut Pro 7 Certification Lesson 5
Final Cut Pro 7 Certification Lesson 5
 

Recently uploaded

Introduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptxIntroduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptxpboyjonauth
 
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...Marc Dusseiller Dusjagr
 
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptx
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptxECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptx
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptxiammrhaywood
 
Employee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptxEmployee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptxNirmalaLoungPoorunde1
 
Interactive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communicationInteractive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communicationnomboosow
 
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️9953056974 Low Rate Call Girls In Saket, Delhi NCR
 
Crayon Activity Handout For the Crayon A
Crayon Activity Handout For the Crayon ACrayon Activity Handout For the Crayon A
Crayon Activity Handout For the Crayon AUnboundStockton
 
Hierarchy of management that covers different levels of management
Hierarchy of management that covers different levels of managementHierarchy of management that covers different levels of management
Hierarchy of management that covers different levels of managementmkooblal
 
Framing an Appropriate Research Question 6b9b26d93da94caf993c038d9efcdedb.pdf
Framing an Appropriate Research Question 6b9b26d93da94caf993c038d9efcdedb.pdfFraming an Appropriate Research Question 6b9b26d93da94caf993c038d9efcdedb.pdf
Framing an Appropriate Research Question 6b9b26d93da94caf993c038d9efcdedb.pdfUjwalaBharambe
 
Capitol Tech U Doctoral Presentation - April 2024.pptx
Capitol Tech U Doctoral Presentation - April 2024.pptxCapitol Tech U Doctoral Presentation - April 2024.pptx
Capitol Tech U Doctoral Presentation - April 2024.pptxCapitolTechU
 
History Class XII Ch. 3 Kinship, Caste and Class (1).pptx
History Class XII Ch. 3 Kinship, Caste and Class (1).pptxHistory Class XII Ch. 3 Kinship, Caste and Class (1).pptx
History Class XII Ch. 3 Kinship, Caste and Class (1).pptxsocialsciencegdgrohi
 
MARGINALIZATION (Different learners in Marginalized Group
MARGINALIZATION (Different learners in Marginalized GroupMARGINALIZATION (Different learners in Marginalized Group
MARGINALIZATION (Different learners in Marginalized GroupJonathanParaisoCruz
 
Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)eniolaolutunde
 
Presiding Officer Training module 2024 lok sabha elections
Presiding Officer Training module 2024 lok sabha electionsPresiding Officer Training module 2024 lok sabha elections
Presiding Officer Training module 2024 lok sabha electionsanshu789521
 
Final demo Grade 9 for demo Plan dessert.pptx
Final demo Grade 9 for demo Plan dessert.pptxFinal demo Grade 9 for demo Plan dessert.pptx
Final demo Grade 9 for demo Plan dessert.pptxAvyJaneVismanos
 
भारत-रोम व्यापार.pptx, Indo-Roman Trade,
भारत-रोम व्यापार.pptx, Indo-Roman Trade,भारत-रोम व्यापार.pptx, Indo-Roman Trade,
भारत-रोम व्यापार.pptx, Indo-Roman Trade,Virag Sontakke
 
EPANDING THE CONTENT OF AN OUTLINE using notes.pptx
EPANDING THE CONTENT OF AN OUTLINE using notes.pptxEPANDING THE CONTENT OF AN OUTLINE using notes.pptx
EPANDING THE CONTENT OF AN OUTLINE using notes.pptxRaymartEstabillo3
 

Recently uploaded (20)

Introduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptxIntroduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptx
 
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
 
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptx
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptxECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptx
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptx
 
Employee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptxEmployee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptx
 
Interactive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communicationInteractive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communication
 
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
 
Crayon Activity Handout For the Crayon A
Crayon Activity Handout For the Crayon ACrayon Activity Handout For the Crayon A
Crayon Activity Handout For the Crayon A
 
Hierarchy of management that covers different levels of management
Hierarchy of management that covers different levels of managementHierarchy of management that covers different levels of management
Hierarchy of management that covers different levels of management
 
OS-operating systems- ch04 (Threads) ...
OS-operating systems- ch04 (Threads) ...OS-operating systems- ch04 (Threads) ...
OS-operating systems- ch04 (Threads) ...
 
Framing an Appropriate Research Question 6b9b26d93da94caf993c038d9efcdedb.pdf
Framing an Appropriate Research Question 6b9b26d93da94caf993c038d9efcdedb.pdfFraming an Appropriate Research Question 6b9b26d93da94caf993c038d9efcdedb.pdf
Framing an Appropriate Research Question 6b9b26d93da94caf993c038d9efcdedb.pdf
 
Capitol Tech U Doctoral Presentation - April 2024.pptx
Capitol Tech U Doctoral Presentation - April 2024.pptxCapitol Tech U Doctoral Presentation - April 2024.pptx
Capitol Tech U Doctoral Presentation - April 2024.pptx
 
History Class XII Ch. 3 Kinship, Caste and Class (1).pptx
History Class XII Ch. 3 Kinship, Caste and Class (1).pptxHistory Class XII Ch. 3 Kinship, Caste and Class (1).pptx
History Class XII Ch. 3 Kinship, Caste and Class (1).pptx
 
TataKelola dan KamSiber Kecerdasan Buatan v022.pdf
TataKelola dan KamSiber Kecerdasan Buatan v022.pdfTataKelola dan KamSiber Kecerdasan Buatan v022.pdf
TataKelola dan KamSiber Kecerdasan Buatan v022.pdf
 
MARGINALIZATION (Different learners in Marginalized Group
MARGINALIZATION (Different learners in Marginalized GroupMARGINALIZATION (Different learners in Marginalized Group
MARGINALIZATION (Different learners in Marginalized Group
 
ESSENTIAL of (CS/IT/IS) class 06 (database)
ESSENTIAL of (CS/IT/IS) class 06 (database)ESSENTIAL of (CS/IT/IS) class 06 (database)
ESSENTIAL of (CS/IT/IS) class 06 (database)
 
Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)
 
Presiding Officer Training module 2024 lok sabha elections
Presiding Officer Training module 2024 lok sabha electionsPresiding Officer Training module 2024 lok sabha elections
Presiding Officer Training module 2024 lok sabha elections
 
Final demo Grade 9 for demo Plan dessert.pptx
Final demo Grade 9 for demo Plan dessert.pptxFinal demo Grade 9 for demo Plan dessert.pptx
Final demo Grade 9 for demo Plan dessert.pptx
 
भारत-रोम व्यापार.pptx, Indo-Roman Trade,
भारत-रोम व्यापार.pptx, Indo-Roman Trade,भारत-रोम व्यापार.pptx, Indo-Roman Trade,
भारत-रोम व्यापार.pptx, Indo-Roman Trade,
 
EPANDING THE CONTENT OF AN OUTLINE using notes.pptx
EPANDING THE CONTENT OF AN OUTLINE using notes.pptxEPANDING THE CONTENT OF AN OUTLINE using notes.pptx
EPANDING THE CONTENT OF AN OUTLINE using notes.pptx
 

Mec e learning2

  • 1. Media Computing Click the arrow to continue.
  • 2. X Contents REQUIREMENTS: This e-learning package requires you to: 1. Go through this presentation 2. Try the sample scripts provided. 3. Create a game using this presentation and the sample scripts to help you. 4. Submit your game through LMS. RESOURCES: You should have downloaded the attached files. You should have 2 partially completed games: - Alien - Prevent_dengue
  • 3. X Use these button for quick access to each set of scripts. Back to the home page. Click to see more of each script block. Quits this presentation Navigating Next page Previous page
  • 4. X Select a set of scripts to begin See Sample scripts Go to Task
  • 5. X Motion Click on the scripts on the left to see what each script does to the worm below.
  • 6. X Move 10 steps Click on the scripts on the left to see what each script does to the worm below. Moves the sprite 10 steps in the current direction.
  • 7. X Turn clockwise Click on the scripts on the left to see what each script does to the worm below. Turns the sprite (X) degrees clockwise.
  • 8. X Turn Anti-clockwise Click on the scripts on the left to see what each script does to the worm below. Turns the sprite (x) degrees anti clockwise.
  • 9. X Point in direction: – 0o Mouse over the different degrees to see what happens 0o 90o -90o 180o Points the sprit in a specified direction.
  • 10. X Point in direction: 180o Mouse over the different degrees to see what happens 0o 90o -90o 180o Points the sprit in a specified direction.
  • 11. X Point in direction: -90o Mouse over the different degrees to see what happens 0o 90o -90o 180o Points the sprit in a specified direction.
  • 12. X Point in direction : 90o Mouse over the different degrees to see what happens 0o 90o -90o 180o Points the sprit in a specified direction.
  • 13. X Point towards: Mouse over the different degrees to see what happens Points the sprit in a specified direction.
  • 14. X Go to X: Y: Instantly moves a sprite to a specified coordinate position. X: 180 X: 150 Y: -200 Y: 200 Y: -150 Centre of the stage is always (0, 0) X: -180 Go to X: 150 Y: -150
  • 15. X Go to (XX): Instantly moves the sprite the location of another sprite or mouse pointer. Go to <Mouse pointer> Sprite goes to wherever the mouse pointer goes
  • 16. X Glide ( )secs to X: Y: Gradually moves the sprite to a specified position over a number of seconds. Y: 180 X: 100 X: 200 X: -200 Y: -50 Y: -180 Glide (3) secs to to X: 100 Y: -50
  • 17. X Change x by ( ) Moves the sprite left or right regardless of direction the sprite is pointing. Click the buttons belowt o compare the effect of the 3 different scripts. Change x by (20) Change x by (-20) Move (20) steps
  • 18. X Change x by ( 20 ) Moves the sprite left or right regardless of direction the sprite is pointing. Click the buttons belowt o compare the effect of the 3 different scripts. Change x by (20) Change x by (-20) Move (20) steps
  • 19. X Change x by ( -20 ) Moves the sprite left or right regardless of direction the sprite is pointing. Click the buttons belowt o compare the effect of the 3 different scripts. Change x by (20) Change x by (-20) Move (20) steps
  • 20. X Move ( 20 ) steps Moves the sprite left or right regardless of direction the sprite is pointing. Click the buttons belowt o compare the effect of the 3 different scripts. Change x by (20) Change x by (-20) Move (20) steps
  • 21. X Move ( 20 ) steps Moves the sprite left or right regardless of direction the sprite is pointing. Click the buttons below to compare the effect of the 3 different scripts. Change y by (20) Change y by (-20) Move (20) steps
  • 22. X Change y by ( ) Moves the sprite up or down regardless of direction the sprite is pointing. Click the buttons below to compare the effect of the 3 different scripts. Change y by (20) Change y by (-20) Move (20) steps
  • 23. X Change y by ( 20 ) Moves the sprite left or right regardless of direction the sprite is pointing. Click the buttons below to compare the effect of the 3 different scripts. Change y by (20) Change y by (-20) Move (20) steps
  • 24. X Change y by ( -20 ) Moves the sprite left or right regardless of direction the sprite is pointing. Click the buttons below to compare the effect of the 3 different scripts. Change y by (20) Change y by (-20) Move (20) steps
  • 25. X If on edge, bounce Usually used when the sprite is moving. When the sprite touches the edge of the screen, it will “bounce” and move in the opposite direction. Mouse over the button below to see an example. Start
  • 26. X If on edge, bounce Usually used when the sprite is moving. When the sprite touches the edge of the screen, it will “bounce” and move in the opposite direction. Mouse over the button below to see an example. Start
  • 27. X Looks Click on the scripts on the left to see what each script does to the worm below.
  • 28. X Switch costume Switch to costume ( ) Next costume Allows you to choose which costume to switch to. Automatically switches to the next costume. back
  • 29. X Switch costume Lets say the worm below has 3 costume. Costume 1 Costume 1 Click the commands below to see what happens to the worm. Switch to costume (costume 1) Costume 2 Switch to costume (costume 2) Switch to costume (costume 3) Next costume
  • 30. X Switch costume Lets say the worm below has 3 costume. Costume 1 Costume 1 Click the commands below to see what happens to the worm. Switch to costume (costume 1) Costume 2 Switch to costume (costume 2) Switch to costume (costume 3) Next costume
  • 31. X Switch costume Lets say the worm below has 3 costume. Costume 1 Costume 1 Click the commands below to see what happens to the worm. Switch to costume (costume 1) Costume 2 Switch to costume (costume 2) Switch to costume (costume 3) Next costume
  • 32. X Switch costume Lets say the worm below has 3 costume. Costume 1 Costume 1 Click the commands below to see what happens to the worm. Switch to costume (costume 1) Costume 2 Switch to costume (costume 2) Switch to costume (costume 3) Next costume
  • 33. X Say Automatically creates a speech balloon to say a specified text. How are You? Say [ How are you ? ] for (3) secs.
  • 34. X Think… Similar to the “say” script, but creates a thought balloon instead. How are you? Think [ How are you ? ] for (3) secs.
  • 35. X Change size by ( ) Changes the size by a specified amount each time the script is used. Negative numbers will shrink the sprite Positive numbers will grow the sprite. Change size by ( 50) Size = 150% Size = 100% Change size by ( - 50) Size = 50%
  • 36. X Set size to ( )% Changes the size by a specified amount once only. Only positive numbers used. Click here and Set Size to see difference between Change Size Set size to (150)% Size = 150% Size = 100% Set size to (50) % Size = 50%
  • 37. back X Change size vs Set size The difference between change size and set size become obvious when the same script is used multiple times. script Size = 100% Used 1st time Used 2nd time Used 3rd time Size = 130% Size = 160% Size = 190% Size = 30% Size = 30% Size – 30% Change size by (30) Size = 100% Set size to (30) %
  • 38. X Show and Hide Show: the sprite can be seen (visible) Hide: the sprite cannot be seen (invisible) Show Hide
  • 39. X Show and Hide Show: the sprite can be seen (visible) Hide: the sprite cannot be seen (invisible) Show Hide
  • 40. X Show and Hide Show: the sprite can be seen (visible) Hide: the sprite cannot be seen (invisible) Show Hide
  • 41. X Sounds This set of scripts allows you to control sounds in your game or animation. Click on one of the highlighted scripts to check what they do.
  • 42. X Play sound ( ) Plays a specified sound. Sound effect must be imported into the sprite library for you to be able to use them. Click Here to find out how to import sounds
  • 43. X Importing sound effects Click on the SOUNDS tab to start importing sound effects.
  • 44. X Importing sound effects Click on the IMPORT button to select the sound effect you need.
  • 45. X Importing sound effects Select the sound that you need and click OK
  • 46. back X Importing sound effects Your sound effect is now imported.
  • 47. X Play sound ( ) until done Plays a specified sound and waits until the sound clip ends before moving on to the next script. Sound effect must be imported into the sprite library for you to be able to use them. Click Here to find out how to import sounds
  • 48. X Stop all sounds Stops all sound effects in the game or animation. Usually used when the game ends or when a condition is met.
  • 49. X Control Click on a set of control scripts. Terminators Loops and conditionals Examples When key pressed; When I receive; When sprite clicked Stop Stop all Examples If, If.. Then.. Else; Repeat loops Forever loops Broadcast
  • 50. X Controls – Terminators Terminators are used to start or stop a set of scripts. Click on a terminator to learn more about it.
  • 51. X When (green flag) clicked The green flag is usually used to start the game or animation. Click on the green flag to start
  • 52. X When (green flag) clicked The green flag is usually used to start the game or animation. Click on the green flag to start Click on another terminator to continue
  • 53. X When ( ) key pressed Key press can also be used to start a game or animation. Key press is a common method to control characters or sprites in a game. Space bar Click on the spacebar above
  • 54. X When ( ) key pressed Key press can also be used to start a game or animation. Key press is a common method to control characters or sprites in a game. Space bar Click on the spacebar above Click “spacebar” to change costume again or click MORE continue. more
  • 55. X Key press as controls Click on the arrow keys to see what each key press does to the worm above Click on another terminator to continue.
  • 56. X When sprite clicked The sprite “worm” changes costume when clicked and changes back after 0.25 seconds. Try clicking on the worm, or click another terminator to continue.
  • 57. X Loops and Conditionals LOOPS A set of scripts that repeats itself. CONDITIONAL LOOPS A set of scripts that repeats itself until a condition is fulfilled. CONDITIONALS An event that must happen to start a set of scripts. CONDITIONALS An event that must happen to start a set of scripts.
  • 58. X Forever Loops Scripts inside the forever loop will be repeated over and over again. Forever Loops can be stopped when the “STOP ALL” command is used. Example:
  • 59. X Conditional Loops Select one of the conditional loops below to find out more. Repeat ( ) Repeat until < >
  • 60. X Repeat ( ) Repeats the script inside the loop a fixed number of times. In the script on the right, the worm moves 10 steps and waits for 0.5 seconds for 3 times. , and then changes costume. Click here to start
  • 61. X Repeat until < > Repeats the script inside the loop a fixed number of times. In the script on the right, the worm moves 10 steps and waits for 0.5 seconds until it touches the edge , and then changes costume. Click here to start
  • 62. X “If” statements If statements specify an event that must happen before the scripts in the statement is run.. Select one of the options below to learn more. IF < > … IF < > … ELSE …
  • 63. X IF < > … The event specified in < > must happen for the script to run. The script on the right shows part of a game. Click on the larger number to score a point. IF you score 3 points, you win. Click here to start
  • 64. X IF < > … The event specified in < > must happen for the script to run. The script on the right shows part of a game. Click on the larger number to score a point. IF you score 3 points, you win. Click here to start
  • 65. X IF < > … The event specified in < > must happen for the script to run. The script on the right shows part of a game. Click on the larger number to score a point. IF you score 3 points, you win. SCORE Click here to start Which number is larger? 34 OR 45 0
  • 66. X IF < > … The event specified in < > must happen for the script to run. The script on the right shows part of a game. Click on the larger number to score a point. IF you score 3 points, you win. SCORE Next question Correct! 1
  • 67. X IF < > … The event specified in < > must happen for the script to run. The script on the right shows part of a game. Click on the larger number to score a point. IF you score 3 points, you win. SCORE Which number is larger? 50 OR 32 1
  • 68. X IF < > … The event specified in < > must happen for the script to run. The script on the right shows part of a game. Click on the larger number to score a point. IF you score 3 points, you win. SCORE Next question Correct! 2
  • 69. X IF < > … The event specified in < > must happen for the script to run. The script on the right shows part of a game. Click on the larger number to score a point. IF you score 3 points, you win. SCORE Which number is larger? 0 OR -1 2
  • 70. X IF < > … The event specified in < > must happen for the script to run. The script on the right shows part of a game. Click on the larger number to score a point. IF you score 3 points, you win. SCORE End game Correct! YOU WIN ! 3
  • 71. X IF < > … The event specified in < > must happen for the script to run. The script on the right shows part of a game. Click on the larger number to score a point. IF you score 3 points, you win. Wrong answer! Please try again. << Back
  • 72. X IF < >… ELSE … The event specified in < > must happen for the script to run. IF < > … ELSE … is used when there are only 2 options. E.g: YES or NO, TRUE or FALSE, A or B. Compare the 2 scripts below: Click each one to see how they work.
  • 73. X IF < >… ELSE … Answer the question below. Click the correct answer. How many hours are there in a day? (A) 24 hours Answer A (B) 30 hours Answer B (C) 78 hours Answer C
  • 74. X IF < >… ELSE … You Win! How many hours are there in a day? (A) 24 hours Answer A (B) 30 hours Answer B (C) 78 hours Answer C
  • 75. X IF < >… ELSE … Almost there! How many hours are there in a day? (A) 24 hours Answer A (B) 30 hours Answer B (C) 78 hours Answer C
  • 76. X IF < >… ELSE … Are you sure? How many hours are there in a day? (A) 24 hours Answer A (B) 30 hours Answer B (C) 78 hours Answer C
  • 77. X IF < >… ELSE … Answer the question below. Click the correct answer How many hours are there in a day? (A) 24 hours Answer A (B) 30 hours Answer B (C) 78 hours Answer C
  • 78. X IF < >… ELSE … You Win! How many hours are there in a day? (A) 24 hours Answer A (B) 30 hours Answer B (C) 78 hours Answer C
  • 79. X IF < >… ELSE … Wrong Answer! How many hours are there in a day? (A) 24 hours Answer A (B) 30 hours Answer B (C) 78 hours Answer C
  • 80. X IF < >… ELSE … Wrong Answer! How many hours are there in a day? (A) 24 hours Answer A (B) 30 hours Answer B (C) 78 hours Answer C
  • 81. X BROADCAST and RECEIVE BROADCAST = Send a message Start Animation RECEIVE = receive the message Sprite 1 Back to controls Sprite 2
  • 82. X BROADCAST and RECEIVE BROADCAST = Send a message RECEIVE = receive the message Change your So much Colour! better! Sprite 1 Back to controls Sprite 2
  • 83. X BROADCAST and RECEIVE BROADCAST = Send a message Restart Animation RECEIVE = receive the message So much better! Notice this speech balloon appeared too early. Sprite 1 Back to controls Sprite 2
  • 84. X BROADCAST and RECEIVE BROADCAST = Send a message RECEIVE = receive the message Lets change this to BROADCAST AND WAIT. So much better! Sprite 1 Back to controls Sprite 2
  • 85. X BROADCAST and RECEIVE BROADCAST = Send a message Start Animation RECEIVE = receive the message Sprite 1 Back to controls Sprite 2
  • 86. X BROADCAST and RECEIVE BROADCAST = Send a message RECEIVE = receive the message Change your So much Colour! better! Sprite 1 Back to controls Sprite 2
  • 87. X Broadcast vs Broadcast and Wait • Broadcast: – Sends the message and continues with the next script • Broadcast and wait – Sends the message, waits for the message to be received carried out, then continues with the next script. Back to controls
  • 88. X Sensing Blocks found under the sensing section are never used alone, except for Ask and Wait. Sensing scripts are used together with other scripts, usually conditional loops and “IF” statements
  • 89. X Operators Operators may be used to specify conditions They may be used together with sensing blocks control blocks. Click on one of the block on the left to continue.
  • 90. X Mathematical operators These are used when mathematical calculation is needed.
  • 91. X Random Number Generator One of the most commonly used script blocks in game design. Generates a random number when used. Click next to see examples:
  • 92. X Examples Points the sprite in a random direction between 0 to 360. Sets the variable (Scene) to either 1 or 2 randomly. Moves the sprite to a random X-position between -200 and 200.
  • 93. X Logical operators Less than. Equals to. Greater than. Examples of Use:
  • 94. X Join [ ] [ ] Joins 2 words together. Used together with the “say” script. Example: Click the 2 scripts below to see what is said.
  • 95. X Join [ ] [ ] Joins 2 words together. Used together with the “say” script. Example: Click the 2 scripts below to see what is said. Your score is 5
  • 96. X Join [ ] [ ] Joins 2 words together. Used together with the “say” script. Example: Click the 2 scripts below to see what is said. Your answer A is correct!
  • 97. X Variables A variable is a memory location set aside to store data types such as numbers, text or dates. This location will contain something when it is first used. Hence, it is important to clear the location and fill it with the value that you want. The process of filling with a start value is called initialisation.
  • 98. X Variables A common variable that we will use frequently is the score of a game. The score is a variable because it keeps changing (varying) when the game is being played. We use the “set” instruction to initialise a variable. For example, we can set a variable “lives” to a start value of 5 by using this instruction:
  • 99. X Variables Checking the variable makes that variable visible on screen.
  • 100. X Variables This instruction can be used to change the value of a variable. The instruction below will change the variable “lives” by 1.
  • 101. X Sample Scripts Alien Invasion Create the scripts for each of the sprite below:
  • 102. X Alien invasion Open the file “Alien”. Create the scripts for each of the sprite below: Click the sprites to see the scripts
  • 103. X Hammer Scripts Mouse over the scripts to see explanations
  • 104. X Hammer Scripts Mouse over the scripts to see explanations When the green flag is clicked, the hammer is reset to the position X: 0, Y: 122. Hammer is visible (show).
  • 105. X Hammer Scripts Mouse over the scripts to see explanations When spacebar is pressed, the hammer moves as if it is being swung. A broadcast message (hit) is sent to see if the hammer hits the alien spaceship.
  • 106. X Hammer Scripts Mouse over the scripts to see explanations When the right arrow key is pressed, the hammer moves right by 10 steps If the x-position of the hammer is more than 200, it is automatically changed to 200. This prevents the hammer from going off the screen.
  • 107. X Hammer Scripts Mouse over the scripts to see explanations When the Left arrow key is pressed, the hammer moves left by 10 steps If the x-position of the hammer is less than -200, it is automatically changed to 200. This prevents the hammer from going off the screen.
  • 108. X Alien Spaceship Scripts Mouse over the scripts to see explanations
  • 109. X Alien Spaceship Scripts Mouse over the scripts to see explanations Initialisation: The Alien spaceship is shown, Lives is reset to 3 Score is reset to 0 Spaceship is moved to a random x-position at y:128
  • 110. X Alien Spaceship Scripts Mouse over the scripts to see explanations Until score=5 or lives=0, the spaceship is moved downwards every 0.2 sec. If the spaceship touches green color (the ground), deduct 1 from the variable lives. Resets by appearing in another random location.
  • 111. X Alien Spaceship Scripts Mouse over the scripts to see explanations If score = 5, the broadcast a WIN message, Otherwise, broadcast a loss message.
  • 112. X Alien Spaceship Scripts Mouse over the scripts to see explanations When the broadcast message “hit” is received, check to see if spaceship is touching the hammer. If touching hammer (sprite 2), increase the score by 1, hide the spaceship. Spaceship reappears at another random x position at the top of the screen.
  • 113. X Background Scripts Mouse over the scripts to see explanations
  • 114. X Alien Spaceship Scripts Mouse over the scripts to see explanations When Green flag is clicked, the game background is shown.
  • 115. X Alien Spaceship Scripts Mouse over the scripts to see explanations When the “lose” broadcast message is received, change background to shown lose-game message.
  • 116. X Alien Spaceship Scripts Mouse over the scripts to see explanations When the “win” broadcast message is received, change background to shown win-game message.
  • 117. X Task for submission. Create a game using scratch as in the video below Submit your game through Ask n Learn.
  • 118. X Game title: Prevent Dengue STATE the problem • This game is about killing Aedes mosquitoes to prevent the spreading of dengue fever. • The aim is to swing the bat to kill the mosquitoes. The mosquito starts randomly from the left side of the screen and moves towards the right. • If the bat hits the mosquito, the score increases by 1. If the mosquito is not hit, the number of lives which begins at 3 will decrease by 1. • The game ends when 5 mosquitoes are killed or the number of lives equals 0.
  • 120. X Game title: Prevent Dengue THINK about what is needed 1. Refer to the flowchart to program the game. 2. Plan the code for the background such that it switches to different scenes depending on the different situations. The three scenes are start of the game, end of the game when 5 mosquitoes are killed, and end of the game when number of lives is zero. 3. Plan the code for the bat such that it can only move up and down within the screen; and it will swing back and forth when the space key is pressed (to simulate hitting the mosquito). 4. Plan the code for the mosquito such that it a) b) c) appears randomly at the left side of the screen; moves from left to right; and tracks the number of mosquitoes and number of lives.
  • 121. X Game title: Prevent Dengue ENGAGE in coding 1. Open a new file and use all the images provided. 2. Create the code for the background and the bat as planned. 3. Save the file as mosquito_<your name>. 4. Create the code for the mosquito as planned. 5. Save your work.
  • 122. X Game title: Prevent Dengue SUBMIT your code through LMS. Name your file as “dengue_your_name” REFINE your code (Challenge) - You may choose not to attempt this section. - Add one or two more mosquitos to your game.