A variable in Scratch Programming is something that can change - ie: score, lives, health bar. Today you're going to create a Score. Read and following the instructions very carefully.
Task 1: Creating a Variable
a) Open your Scratch game from your Sites folder and create a 'score' variable. You'll need to find the Orange Variable icon. Yours could say DATA instead of Variable, so check carefully.
Follow this diagram
Follow this diagram
Task 2: Enemy Score
a) Add script to your main character/ goody that sets the score to '0' when the game starts
b) Add script to your 'enemy /baddy ' that will decrease the score by 10 points (-10) when you hit it
Task 3: Collecting Points
a) Load or create a sprite to act as way to collect points (coin, heart, jewel etc.)
b) Add script to your 'good item' that will increase the score by 10 points
EXTENSION:
Try adding a life or health variable into the game
OR
Have a go at some coding with:
https://codecombat.com/
https://code.org/learn
http://barclayscodeplayground.co.uk/
Have a go at some coding with:
https://codecombat.com/
https://code.org/learn
http://barclayscodeplayground.co.uk/
No comments:
Post a Comment