Loading presentation...

Present Remotely

Send the link below via email or IM

Copy

Present to your audience

Start remote presentation

  • Invited audience members will follow you as you navigate and present
  • People invited to a presentation do not need a Prezi account
  • This link expires 10 minutes after you close the presentation
  • A maximum of 30 users can follow your presentation
  • Learn more about this feature in our knowledge base article

Do you really want to delete this prezi?

Neither you, nor the coeditors you shared it with will be able to recover it again.

DeleteCancel

Make your likes visible on Facebook?

Connect your Facebook account to Prezi and let your likes appear on your timeline.
You can change this under Settings & Account at any time.

No, thanks

Advanced Scratch 2017

No description
by

Neil Rickus

on 24 February 2017

Comments (0)

Please log in to add your comment.

Report abuse

Transcript of Advanced Scratch 2017

Advanced Scratch

Neil Rickus
@computingchamps


computingchampions.co.uk/virtualpet2017
Senior Lecturer in Computing Education
University of Hertfordshire
CAS East Regional Centre Project Lead
BCS / CAS certificate assessor
CEOP Ambassador
Raspberry Pi Certified Educator
Independent consultant
Writing
MOOCs
Conferences
Workshops
Training


Data structures (lists)
Boolean logic
Develop modular programs
(procedures)
Making a virtual pet


Familiar interface
Example programs
Can still be used at KS3
(but do need two languages)
Using Scratch


Introduce concepts
Demo implementation
Give instructions for task
Scratch blocks (if needed)

C3B4ME
Paired Programming
During the session
Online version of Scratch
scratch.mit.edu
Example of final project...
• Choose a suitable sprite for your program’s virtual pet
• Create a variable named
PetHunger
, which starts with a value of 50 and reduces by 1 every 0.5 seconds
• Once the value of
PetHunger
reaches zero, your sprite should “die” with an appropriate message




Add extra events when your sprite dies
• Create a Block named
Kill
• Add a number of instructions to this block, which should be undertaken when the sprite “dies” (e.g. display a message to the screen, rotate 90 degrees, change the costume, etc)
• Make the
Kill
block instructions take place once
PetHunger
has reached zero

Add different backgrounds for each
part of your program
• Create a list named
Hungry
• Add three items to the list, which are displayed when your sprite requires food (e.g. “Feed me”, “Gimme food”, “Sooo hungry”, etc)
• Make items from the
Hungry
list display randomly on the screen

Add a second list named
Healthy
containing messages to be displayed if your sprite is ok
• Make your
Hungry
messages only display when your pet is hungry (value of
PetHunger
is less than 50)
AND
at regular intervals (Hint – you may wish to research what the
mod
or “modulus” block does in Scratch)

Make your
Healthy
list messages display if
PetHunger
is more than 50
• Add a second sprite, which, when clicked, increases the value of
PetHunger
by 10 and displays an appropriate message
• Ensure the value of
PetHunger
cannot go above 100. Display an appropriate message if the pet cannot be fed

Change the sprite's costume to acknowledge being fed
• Create a second list named
Thirst
• Using
Notepad
, add the items to be included to the list into a text file

Import
the items from the text file into the list

Add further items to the list from within Scratch and
export
the list to a file
• Create a second variable named
PetThirst
, which also starts at 50 and reduces by 1 every 0.5 seconds
• Alter your program so once the value of
PetHunger

OR

PetThirst
reaches zero, your sprite should “die”
• Make your
Thirst
messages only display when your pet is thirsty (value of
PetThirst
is less than 50)
AND
at regular intervals, but at different times to the
Hunger
messages

Make your sprite die in different ways depending on whether they were hungry or thirsty
• Add a third sprite, which, when clicked, increases the value of
PetThirst
by 10 and displays an appropriate message
• Ensure the value of
PetThirst
cannot go above 100. Display an appropriate message if the pet cannot be given more liquid

Change the sprite's costume to acknowledge being given liquid
• Create a Block named
Status
, which contains the instructions to display the text from
Hungry
and
Thirst
at regular intervals
• Alter your program so the
Status
block is used at appropriate time(s)

Try out some of the further enhancements...
Virtual Pet - Further enhancements

• Add further variables and sprites to manage your pet’s happiness and / or toilet visits
• Display alternative costumes when the sprite is hungry, thirsty, etc or dies
• Add alternative backgrounds for different sections of the program
• Make the cat randomly be silly
• Pass the values of the variables PetHunger, PetThirst etc to your Status block, rather than using the variables values directly (Google “why do we avoid using global variables?”)
• Add a “Maintenance Mode”, which allows messages to be added or deleted to a specific list within the game

Allow the pet to be selected, or bought, before starting
@computingchamps
Teaching it...
Discuss how you
found today's
session
Within school
Pupils will often know
more than you
Embrace it
Digital
Leaders
Pupils will
make mistakes
Ok to reuse
code (if you
understand it!)
Differentiate
Limit sprite and
background creation
Other technology
FlowGo /
Go Control
Python
Raspberry Pi
Kodu
Teaching methods
Tinkering
Discussion
Direct instruction
Making
Connecting
Practise...
Procedures
Set of instructions we
can reuse throughout
our program
Used to perform a
specific task
Called
Blocks
within
Scratch
N.B. Scratch does not
include
Functions
(it can't return values -
you can in
Snap!
)
http://www.bbc.co.uk/education/guides/z9hykqt/revision
Lists
Store multiple pieces
of information at once
Each list item is
paired with a number
Often called an
Array
in other programming
environment
Items can be retrieved
by referencing their
number within the list
http://www.bbc.co.uk/education/guides/z4tf9j6/revision/2
Boolean logic
AND, OR, NOT
AND - instructions will take place if both conditions are true
http://www.bbc.co.uk/education/guides/zc4bb9q/revision/2
OR - instructions will take place if at least one condition is true
NOT - instructions will take place if the condition is not true (i.e. false)
Neil Rickus
I normally introduce procedures
with Logo by drawing the
Square Alphabet
http://code-it.co.uk/year3plan/logoplan/
to square repeat 4 [fd 100 rt 90] end
I normally introduce these with a
quick unplugged activity...


Selection (if, then, else)
Repetition (x number, forever, repeat until)
Variables
Prior knowledge
Make our code more
manageable
micro:bit
https://www.microbit.co.uk/td/lessons/digital-pet/tutorial
While we're waiting....

Tell someone near you
what these programming
concepts involve:
- sequencing
- selection
- repetition (including different types)
- variables
Full transcript