In this project, you will create a memory game where you have to memorise and repeat a sequence of random colours!

Similar documents
Memory. Introduction. Scratch. In this project, you will create a memory game where you have to memorise and repeat a sequence of random colours!

In this project you ll learn how to create a times table quiz, in which you have to get as many answers correct as you can in 30 seconds.

Add in a new ghost sprite, and a suitable stage backdrop.

In this project you ll learn how to create a game, in which you have to match up coloured dots with the correct part of the controller.

Brain Game. Introduction. Scratch

Create Your Own World

In this project you ll learn how to create a platform game, in which you have to dodge the moving balls and reach the end of the level.

In this project you ll learn how to create a game in which you have to save the Earth from space monsters.

In this project we ll make our own version of the highly popular mobile game Flappy Bird. This project requires Scratch 2.0.

Let s start by making a pencil, that can be used to draw on the stage.

ChatBot. Introduction. Scratch. You are going to learn how to program your own talking robot! Activity Checklist. Test your Project.

Create Your Own World

Let s start by making a pencil that can be used to draw on the stage.

Fireworks. Level. Introduction: In this project, we ll create a fireworks display over a city. Activity Checklist Follow these INSTRUCTIONS one by one

Clone Wars. Introduction. Scratch. In this project you ll learn how to create a game in which you have to save the Earth from space monsters.

Lost in Space. Introduction. Scratch. You are going to learn how to program your own animation! Activity Checklist.

Scratch for Beginners Workbook

You are going to learn how to create a game in which a helicopter scores points by watering flowers in the city.

Open the Tech Toys Scratch project. Your club leader will give you a copy of this project, or you can open it online at jumpto.cc/toys-go.

Rock Band. Introduction. Scratch. In this project you ll learn how to code your own musical instruments! Activity Checklist.

In this project you ll learn how to code your own musical instruments!

Creating Computer Games

Create a game in which you have to guide a parrot through scrolling pipes to score points.

Lesson 8 Tic-Tac-Toe (Noughts and Crosses)

Where's the Treasure?

Whack-a-Witch. Level. Activity Checklist Follow these INSTRUCTIONS one by one. Test Your Project Click on the green flag to TEST your code

Part II: Number Guessing Game Part 2. Lab Guessing Game version 2.0

Before displaying an image, the game should wait for a random amount of time.

Ghostbusters. Level. Introduction:

Step 1 : Earth and Mars Orbit the Sun

Lesson 2 Game Basics

Explore and Challenge:

Flappy Parrot Level 2

Create a Simple Game in Scratch

Programming with Scratch

Introduction to Turtle Art

Pong Game. Intermediate. LPo v1

Teaching Kids to Program. Lesson Plan: Interactive Holiday Card

a. the costumes tab and costumes panel

GAME PROGRAMMING & DESIGN LAB 1 Egg Catcher - a simple SCRATCH game

AIM OF THE GAME GLACIER RACE. Glacier Race. Ben Gems: 20. Laura Gems: 13

Game Making Workshop on Scratch

Starting from LEARNER NOTES edited version. An Introduction to Computing Science by Jeremy Scott

How to do automatic horizontal background scrolling in Scratch

Pong! The oldest commercially available game in history

Unit 5: What s in a List

Project 1: Game of Bricks

A. creating clones. Skills Training 5

Module 4 Build a Game

Fish Chomp. Level. Activity Checklist Follow these INSTRUCTIONS one by one. Test Your Project Click on the green flag to TEST your code

Assessment. Self Assessment. Teacher Assessment. Date Learning Objective(s) Achievement or. NC Level: Game Control Student Booklet P a g e 1

The Beauty and Joy of Computing Lab Exercise 10: Shall we play a game? Objectives. Background (Pre-Lab Reading)

Creating a Maze Game in Tynker

Parallax Scrolling Tutorial Created in Drogheda by Seamus Minogue and updated for Clonakilty CoderDojo 15/06/2012 PARALLAX SCROLLING

Alright! I can feel my limbs again! Magic star web! The Dark Wizard? Who are you again? Nice work! You ve broken the Dark Wizard s spell!

pla<orm-style game which you can later add your own levels, powers and characters to. Feel free to improve on my art

In this project, you ll learn how to create 2 random teams from a list of players. Start by adding a list of players to your program.

STEP-BY-STEP THINGS TO TRY FINISHED? START HERE NEW TO SCRATCH? CREATE YOUR FIRST SCRATCH PROJECT!

Introducing Scratch Game development does not have to be difficult or expensive. The Lifelong Kindergarten Lab at Massachusetts Institute

Copyright 2017 MakeUseOf. All Rights Reserved.

1hr ACTIVITY GUIDE FOR FAMILIES. Hour of Code

Defend Hong Kong s Technocore

INTERACTING SPRITES MODULE 3: INVESTIGATION 1. Anima9ng Sprites

Scratch Programming Lesson 13. Mini Mario Game Part 4 Platforms

Pong! The oldest commercially available game in history

Objective of the lesson

Module. Introduction to Scratch

2: Turning the Tables

Lesson 1 Getting Started. 1. What are the different ways you interact with computers?

Programming I (mblock)

Scratch Coding And Geometry

An Introduction to ScratchJr

Explore and Challenge:

CISC 1600, Lab 2.2: More games in Scratch

Words Mobile Ready Game Documentation

SAMPLE CHAPTER

Pass-Words Help Doc. Note: PowerPoint macros must be enabled before playing for more see help information below

OZOBLOCKLY BASIC TRAINING LESSON 1 SHAPE TRACER 1

Inspiring Creative Fun Ysbrydoledig Creadigol Hwyl. Kinect2Scratch Workbook

Ada Lovelace Computing Level 3 Scratch Project ROAD RACER

KEEPING SCORE: HOW TO USE SCORES, LIVES AND HEALTH

Controlling a Sprite with Ultrasound

Kaltura CaptureSpace Lite Desktop Recorder: Editing, Saving, and Uploading a Recording

Programming. covers Scratch 2.0 and Scratch 1.4. Foreword by Mitchel Resnick MIT Media Lab PLAIN ENGLISH EASY TO FOLLOW FULLY ILLUSTRATED

Defend Hong Kong s Technocore

Taffy Tangle. cpsc 231 assignment #5. Due Dates

Editing the standing Lazarus object to detect for being freed

Maths Quiz. Make your own Mental Maths Game

Welcome to the Break Time Help File.

Computer with Scratch program.

Welcome to Weebly. Setting up Your Website. Write your username here:

Welcome to Family Dominoes!

Objectives: Learn what an Arduino is and what it can do Learn what an LED is and how to use it Be able to wire and program an LED to blink

Scratch Primary Lesson 5

Assignment II: Set. Objective. Materials

Creating Interactive Games in a Flash! Candace R. Black

Write algorithms with variables. Phil Bagge code-it

VERSION 3.0 WINDOWS USER GUIDE

CHM 152 Lab 1: Plotting with Excel updated: May 2011

How to use Photo Story 3

Transcription:

Memory Introduction In this project, you will create a memory game where you have to memorise and repeat a sequence of random colours! Step 1: Random colours First, let s create a character that can change to a random sequence of colours for the player to memorise. Activity Checklist Start a new Scratch project, and delete the cat sprite so that your project is empty. You can find the online Scratch editor at jumpto.cc/scratchnew. Choose a character and a backdrop. Your character doesn t have to be a person, but it needs to be able to show different colours. 1

In your game, you ll use a different number to represent each colour: 1 = red; 2 = blue; 3 = green; 4 = yellow. Give your character 4 different colour costumes, one for each of the 4 colours above. Make sure that your coloured costumes are in the right order. 2

To create a random sequence, you need to create a list. A list is just a variable that stores lots of data in order. Create a new list called sequence. As only your character needs to see the list, we can also click For this sprite only. You should now see your empty list in the top-left of your stage, as well as lots of new blocks for using lists. 3

Add this code to your character, to add a random number to your list (and show the correct costume) 5 times: when clicked delete all of repeat 5 add pick random 1 to 4 to switch costume to item last of wait 1 secs Notice that you have also emptied the list to begin with. Challenge: Adding sound Test your project a few times. You may notice that sometimes the same number is chosen twice (or more) in a row, making the sequence harder to memorise. Can you make a drum 4

sound play each time the character changes costume? Can you make a different drum sound play depending on the random number chosen? This will be very similar to your code to change the character s costume. Save your project Step 2: Repeating the sequence Let s add 4 buttons, for the player to repeat the sequence they ve remembered. Activity Checklist Add 4 sprites to your project, that will become buttons. Edit your 4 sprites, so that there s 1 for each of the 4 colours. When the red drum is clicked, you ll need to broadcast a message to your character, letting them know that the red button has been clicked. Add this code to your red drum: 5

when this sprite clicke d broadcast red When your character receives this message, they should check whether the number 1 is at the start of the list (which means that red is the next colour in the sequence). If it is, you can remove the number from the list, as it s been guessed correctly. Otherwise it s game over! when I receive red if item 1 of = then 1 delete 1 of else say Game over! for 1 sec s stop all You could also display some flashing lights once the list is empty, as it means the entire sequence has been guessed correctly. Add this code to the end of your character s when flag clicked script: wait until length of 0 = broadcast wait won and Click on your stage, and add this code to play any sound and make the backdrop change colour once the player has won. 6

when I receive repeat 50 won play sound drum machine change color effect by 25 wait 0.1 secs clear graphic effect s Challenge: Creating 4 buttons Repeat the steps above for your blue, green and yellow buttons. Which code will stay the same, and which code will change for each button? You can also add sounds for when the buttons are pressed. Remember to test the code you ve added! Can you memorise a sequence of 5 colours? Is the sequence different each time? Save your project Step 3: Multiple levels So far, the player only has to remember 5 colours. Let s improve your game, so that the length of the sequence increases. Activity Checklist Create a new variable called score. 7

This score will be used to decide on the length of the sequence the player has to memorise. So, to begin with the score (and the sequence length) is 3. Add this code block to the start of your character s when flag clicked code: set score to 3 Instead of always creating a sequence of 5 colours, you now want the score to determine the sequence length. Change your character s repeat loop (for creating the sequence) to: repeat score If the sequence is guessed correctly, you should add 1 to the score, to increase the length of the sequence. change score by 1 Finally, you need to add a forever loop around the code to generate the sequence, so that a new sequence is created for each level. This is how your character s code should look: 8

when clicked set score to 3 forever delete all of repeat add score pick random 1 to 4 to switch costume to item last of wait 1 secs wait until length of 0 = broadcast wait won and change score by 1 Get your friends to test out your game. Remember to hide the sequence list before they play it! Save your project Step 4: High score Let s save the high score, so that you can play against your friends. Activity Checklist Add 2 new variables to your project, called high score and name. If ever the game ends (by pressing the wrong button), you need to check whether the player s score is higher than the current high score. If it is, you need to save the score as the high score, and store the name of the player. Here s how your red button should look: 9

when I receive red item 1 of if = then 1 delete 1 of else say Game over! for 1 sec s if score > high scor e then set high score to score ask High score! What is your name? wait and set name to answer stop all You ll need to add this new code to the other 3 buttons too! Have you noticed that the Game over code in each of the 4 buttons is exactly the same? If ever you need to change any of this code, such as adding a sound or changing the Game over! message, you d have to change it 4 times! That could get annoying, and waste a lot of time. Instead, you can define your own blocks, and reuse them in your project! To do this, click more blocks, and then Make a block. Call this new block Game over. 10

Add the code from the else block from the red button to the new block that appears: You ve now made a new function called Game over, which you can use anywhere you like. Drag your new Game over block onto the 4 scripts for the buttons. 11

Now add a sound for when the wrong button is pressed. You only need to add this code once in the Game over block that you made, and not 4 separate times! Challenge: Making more blocks Do you notice any other code that is the same for all 4 buttons? Can you make another custom block, that is used by each button? Save your project 12

Challenge: Another costume Have you noticed that your game starts with your character showing one of the 4 colours, and that they always display the last colour in the sequence while the player is repeating the sequence? Can you add another plain white costume to your character, which is displayed at the start of your game, and when the player is trying to copy the sequence? Save your project Challenge: Difficulty level Can you allow your player to choose between easy mode (using just the red and blue drums) and normal mode (which uses all 4 drums)? You could even add a hard mode, which makes use of a 5th drum! 13

Save your project 14