Module 4 Build a Game

Similar documents
abc 3 def. 4 ghi 5 jkl 6 mno. Computers Rule the World

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.

Create Your Own World

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

LECTURE 03 BITMAP IMAGE FORMATS

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.

Flappy Parrot Level 2

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

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.

1. Describe how a graphic would be stored in memory using a bit-mapped graphics package.

Scratch for Beginners Workbook

Specific structure or arrangement of data code stored as a computer file.

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

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

Introduction to Photography

Brain Game. Introduction. Scratch

Project 1: Game of Bricks

INTRODUCTION TO COMPUTER GRAPHICS

Pong Game. Intermediate. LPo v1

TEST INFORMATION: 40 questions 50 minutes 70% minimum required to pass. Score is based on a 1000 pt system so passing will be a 700.

15110 Principles of Computing, Carnegie Mellon University

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

4/9/2015. Simple Graphics and Image Processing. Simple Graphics. Overview of Turtle Graphics (continued) Overview of Turtle Graphics

Ghostbusters. Level. Introduction:

MOTION GRAPHICS BITE 3623

Introduction to Turtle Art

CONCEPTS EXPLAINED CONCEPTS (IN ORDER)

PENGENALAN TEKNIK TELEKOMUNIKASI CLO

For all question related to Photoshop that we cannot address in class, start by looking at the excellent Photoshop help: Help > Photoshop Help.

15110 Principles of Computing, Carnegie Mellon University

HTTP transaction with Graphics HTML file + two graphics files

Factors to Consider When Choosing a File Type

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

Indexed Color. A browser may support only a certain number of specific colors, creating a palette from which to choose

Developing Multimedia Assets using Fireworks and Flash

Graphics for Web. Desain Web Sistem Informasi PTIIK UB

Photoshop CS6. Table of Contents. Image Formats! 3. GIF (Graphics Interchange Format)! 3. JPEG or JPG (Joint Photographic Experts Group)!

Digital Images. Digital Images. Digital Images fall into two main categories

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

Creating Computer Games

Programming with Scratch

Activity. Image Representation

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

Create a Simple Game in Scratch

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.

Working with Photos. Lesson 7 / Draft 20 Sept 2003

Lesson 2 Game Basics

Inspiring Creative Fun Ysbrydoledig Creadigol Hwyl. Kinect2Scratch Workbook

Bitmap Vs Vector Graphics Web-safe Colours Image compression Web graphics formats Anti-aliasing Dithering & Banding Image issues for the Web

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

raw format format for capturing maximum continuous-tone color information. It preserves all information when photograph was taken.

VACUUM MARAUDERS V1.0

The BIOS in many personal computers stores the date and time in BCD. M-Mushtaq Hussain

Create Your Own World

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

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!

Programming I (mblock)

COMPUTING CURRICULUM TOOLKIT

More Actions: A Galaxy of Possibilities

Star Defender. Section 1

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

Using Adobe Photoshop

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

Byte = More common: 8 bits = 1 byte Abbreviation:

A. creating clones. Skills Training 5

Step 1 : Earth and Mars Orbit the Sun

B.Digital graphics. Color Models. Image Data. RGB (the additive color model) CYMK (the subtractive color model)

Understanding Image Formats And When to Use Them

Bitmap Image Formats

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

my bank account number and sort code the bank account number and sort code for the cheque paid in the amount of the cheque.

UNIT 7C Data Representation: Images and Sound

Module 1 Getting Started

CISC 1600, Lab 2.2: More games in Scratch

Applying mathematics to digital image processing using a spreadsheet

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

Fundamentals of Multimedia

1. Using Images on Web Pages 2. Image Formats 3. Bitmap Image Formats

LECTURE 02 IMAGE AND GRAPHICS

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

CS101 Lecture 12: Digital Images. What You ll Learn Today

BE SURE TO COMPLETE HYPOTHESIS STATEMENTS FOR EACH STAGE. ( ) DO NOT USE THE TEST BUTTON IN THIS ACTIVITY UNTIL THE END!

In the following sections, if you are using a Mac, then in the instructions below, replace the words Ctrl Key with the Command (Cmd) Key.

Photoshop: a Beginner s course. by: Charina Ong Centre for Development of Teaching and Learning National University of Singapore

Digital photo sizes and file formats

Raster (Bitmap) Graphic File Formats & Standards

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

Elements of Design. Basic Concepts

Game Making Workshop on Scratch

Overview. The Game Idea

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

Tutorial: Creating maze games

UNIT 7C Data Representation: Images and Sound Principles of Computing, Carnegie Mellon University CORTINA/GUNA

Ada Lovelace Computing Level 3 Scratch Project ROAD RACER

Photoshop Elements Week 1 - Photoshop Elements Work Environment

Next Back Save Project Save Project Save your Story

The next table shows the suitability of each format to particular applications.

Pong! The oldest commercially available game in history

U-MARQ Universal Engraving. Bitmap Function. Chapter 12 Bitmaps. Bitmap Menu. Insert Bitmap

Transcription:

Module 4 Build a Game Game On 2 Game Instructions 3 Exercises 12 Look at Me 13 Exercises 15 I Can t Hear You! 17 Exercise 20 End of Module Quiz 20 2013 Lero

Game On Design a Game When you start a programming project it is a good idea to brainstorm away from the computer. Lets start with a simple computer game. It has 2 characters and a backdrop. Fill in the worksheet to get inspiration and ideas for your game. Read through the design features carefully to understand how to play the game before you get it working in Scratch. 1. Description of your Good Guy Character 2. Description of your Bad Guy Character 3. Description of the Backdrop you would like to use for your game 4. Game controls. Describe a special action that you can program for the spacebar key (E.g. jump, make Sprite disappear). Key Used Up Arrow Down Arrow Left Arrow Right Arrow Space Bar Movement Move Up Move Down Move Left Move Right 2 Scratch Workbook

Game Instructions 1. Start by introducing the 2 characters to the game. It is useful to give your sprites meaningful names. 2. Add a backdrop to the game. Don t forget to use the ideas from your design on the previous page Module 4 3

3. Select the Good Guy in the sprite selection area. 4. Program the Good Guy to move using the arrow keys. 5. Program the Bad Guy to move randomly. 4 Scratch Workbook

6. We want something to happen in our game when the Good Guy touches the Bad Guy. To trigger this we need to use a conditional statement called an if statement. As the Good Guy will be impacted when the collision occurs we will select the Good Guy and add a script for him. 7. Add a conditional statement that causes a reaction when the Good Guy senses the Bad Guy touching him. Module 4 5

8. Program the behaviour that occurs when the 2 characters touch. See a possible set of behaviours below. 9. We are going to create a variable to store a value that changes during the game. This variable tracks the number of lives remaining for the Good Guy. 6 Scratch Workbook

10. It is time to include the variable in the Good Guy script. When the game is started the number of lives will be set (initialised) to 5. A conditional statement was used to track every time the Bad Guy touches the Good Guy. Include a line in this script to decrease the number of lives by one when the sprites collide. 11. Next program the Good Guy to broadcast a message saying Game Over if the number of lives is equal to zero. Module 4 7

12. Program both sprites to disappear when the Game Over broadcast message is received. 13. Program the backdrop of the stage to change when the Game Over broadcast message is received. 8 Scratch Workbook

14. Test out the game by running it until the game is over. Does anything strange happen when the green flag is clicked again to restart the game? We need to program the Good Guy and Bad Guy to reappear when the green flag is clicked using the show command. The backdrop needs to be reset too. Module 4 9

15. You will now change what the Good Guy says when he touches the Bad Guy. He will say something different or random each time. To do this we will use Lists, which can be found under the Data blocks category in Scratch. 16. To add to the list, click on the + button at the bottom left of the list. The length will increase by one each time you add to the list, as shown. Add 4 things the Good Guy will say when touched by the Bad Guy. 10 Scratch Workbook

17. Next program the Good Guy sprite to say any of the items on the Things to say list, if he is touching the Bad Guy sprite. 18. If you do not wish the list monitor to be visible on stage you can uncheck the box next to Things to say as shown in the following image. Module 4 11

Exercises Testing is very important to ensure the game is working correctly. Run the tests outlined below to test the functionality of your game. Game Feature Bad Guy moves randomly so the Good Guy can t guess where he is going. The Good Guy starts the game with 5 lives. If the Good Guy is touching Bad Guy then the Good Guy loses a life. If the Good Guy s lives become equal to zero the game stops and a Game Over backdrop appears. When the Game restarts the background is reset and the lives are initialised back to 5. Working? Improvements. Describe what improvements you would make to the game Create version 2 of the game that has the new features below included. Enhance the Good Guy functionality by including a costume change when moving in different directions. When the spacebar key is hit make the Good Guy character jump up in the air. Alter the random movement of the Bad Guy to make the speed and motion appear as realistic as possible. Develop a scoring system for the game and a way of winning or losing at the end of the game. Introduce levels to the game. The speed and movement of the Bad Guy increases as the levels progress. Add a list of things for the Bad Guy to say if touching the Good Guy. 12 Scratch Workbook

Look at Me 1 Computer screens are divided up into a grid of small dots called pixels. The word pixel is a derived from picture element. On a black and white screen, each pixel is either black or white. As computers can only really store numbers there needs to be a way that a computer can understand how to use a set of numbers stored in a file in a way to display them as an image on the screen. This shows a picture of a letter a that has been magnified so that the dots are visible. When a computer stores the picture, all that it needs to store is which dots are black and which are white. The first line consists of one white pixel, then three black, then one white. Thus the first line is represented as 1, 3, 1. Note: The first number always relates to the number of white pixels. If the first pixel is black the line will begin with a zero. Now that you understand how a basic black and white image is stored think about the amount of data required to store an image with thousands of different colour combinations. 1 Based on Computer Science Unplugged Activity 02 Image Representation http://csunplugged.com Module 4 13

We are going to examine compression, which decreases the file size of images so they can be stored and transmitted more efficiently. Compression involves minimizing the size in bytes of a graphics file or image file. Three common file compression formats used for images are JPEG, GIF and PNG. JPEG The Joint Photographic Experts Group works best for: Compressing high-quality images such as photographs and detailed artwork, without sacrificing quality. Handling subtle shading and colour blends more efficiently. GIF The Graphics Interchange Format works best for Images with solid areas of colour Line drawings or logos Transparency effect Animation PNG The Portable Network Graphics works best for Open Source, no licence required by developers, unlike GIFs. Widely supported by the Web. Will never completely replace GIF, as it does not support animation. Scratch and Graphics Scratch accepts the following file formats for images or photos: JPG, BMP (Bitmap image files are not compressed), PNG, and GIF (including animated GIF). 14 Scratch Workbook

Exercises Use the instructions below to draw three pictures in the boxes below. Use the numbers to colour in the squares for each picture. There is a row of numbers for each line in the pictures. For example the line 4, 9, 2, 1 means you leave 4 squares empty, colour in the next 9, leave 2 empty and colour in the next 1. Remember 0 at the start means there are no white pixels at the start of the line. This means the line will start with black pixels. Module 4 15

Now that you know how numbers can represent pictures, why not make your own coded picture for a friend. Draw your pictures in the grids and when you have finished, write the code numbers beside the grids. You do not have to use the whole grid. Just leave some blank lines at the bottom if your picture does not take up the whole grid. 16 Scratch Workbook

I Can t Hear You! Sound formats in Scratch Scratch can read MP3 files and uncompressed WAV, AIF, and AU files. Just like images, sounds can also be compressed to make them smaller in size. MP3 files are an example of this. So what s it all about?... Uncompressed sound files: AIF files Gold standard of audio files, Highest-of-high-quality uncompressed audio that you can save on a disc. AIF files sound great, but files are huge. WAV file, or waveform audio file Known as simply.wav after its extension. A common type of sound file. Can also be quite large. AU file An audio file typically created on a Sun Microsystems or Unix-based machine. Not that common and quite large. Compressed sounds - MP3 MP3 files contain music and other audio. They are popular because they compress music down to a very small size while maintaining quality. Files are small, making MP3s ideal for ipods and for the internet. And now over to you Go to the website http://www.pacdv.com/sounds All sounds are in mp3 or wav formats suitable for use in Scratch. Choose a sound effect you would like to add to your project in Scratch by following instructions on the next page. Module 4 17

Using Scratch with a sound that you have downloaded to your computer Here is a sample script that you could use for this sound 18 Scratch Workbook

Using Scratch to record your own sounds It is easy to give your sou Module 4 19

Exercise Add sound effects to the game that you made earlier in this module. You could include background music for the game, sound effects when the Good Guy touches the Bad Guy and when the game is over. End of Module Quiz The first step of creating a new game is A. Design B. Test C. Debug D. Program What will happen when the Ghost touches a cactus in the script shown below 20 Scratch Workbook

A feature in Scratch that sends a message to all sprites, then continues with the next block without waiting for the triggered scripts is known as A. Wait B. Broadcast C. If D. When Which one of the images below matches the output when the script is run on the list below? Decreasing the file size of images so they can be stored and transmitted more efficiently is known as A. Depression B. Compression C. Pixilation D. Reduction What is the most suitable format for storing a high quality photographic image A. GIF B. JPEG C. PNG D. TIFF Which one of these audio file formats is most suitable for use in Scratch A. AIF B. AU C. MP3 D. MPEG Module 4 21