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

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

Create a Simple Game in Scratch

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

Creating Computer Games

Flappy Parrot Level 2

Lesson 2 Game Basics

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

CISC 1600, Lab 2.2: More games in Scratch

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

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

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.

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

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

Ghostbusters. Level. Introduction:

Scratch for Beginners Workbook

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

Brain Game. Introduction. Scratch

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

Computer with Scratch program.

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

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

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

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

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.

Pong Game. Intermediate. LPo v1

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.

Introduction to Turtle Art

Teaching Kids to Program. Lesson Plan: Interactive Holiday Card

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

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

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

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

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

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

CONCEPTS EXPLAINED CONCEPTS (IN ORDER)

Scratch Programming Lesson 13. Mini Mario Game Part 4 Platforms

Programming with Scratch

Overview. The Game Idea

a. the costumes tab and costumes panel

Step 1 : Earth and Mars Orbit the Sun

Pong! The oldest commercially available game in history

Create Your Own World

GAME:IT Junior Bouncing Ball

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

Explore and Challenge:

Create Your Own World

How to do automatic horizontal background scrolling in Scratch

04. Two Player Pong. 04.Two Player Pong

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.

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

Inspiring Creative Fun Ysbrydoledig Creadigol Hwyl. Kinect2Scratch Workbook

Scratch Primary Lesson 5

GAME:IT Bouncing Ball

Your First Game: Devilishly Easy

Introduction. Overview

Copyright 2017 MakeUseOf. All Rights Reserved.

Objectives: Create Sprites Create Sounds Create Objects Create Room Program simple game

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.

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

Project 1: Game of Bricks

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

GAME:IT Junior Bouncing Ball

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!

Defend Hong Kong s Technocore

THE TECHNOLOGY AND CRAFT OF COMPUTER GAME DESIGN An introductory course in computer game design

More Actions: A Galaxy of Possibilities

COMPUTING CURRICULUM TOOLKIT

Scratching the Surface of Pong: Enriching Linear Equations with Computer Programming

Tinker Tuesday Project - Wood Book Covers

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

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

KEEPING SCORE: HOW TO USE SCORES, LIVES AND HEALTH

G54GAM Lab Session 1

A. creating clones. Skills Training 5

Pong! The oldest commercially available game in history

Game Making Workshop on Scratch

Module 4 Build a Game

Assessment: Reverse Engineering

DESIGN A SHOOTING STYLE GAME IN FLASH 8

uiulearn TUTORIAL INTEGRATIONS> HOW TO USE PANOPTO (STUDENT)

2D Platform. Table of Contents

Star Defender. Section 1

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

Editing the standing Lazarus object to detect for being freed

1 Shooting Gallery Guide 2 SETUP. Unzip the ShootingGalleryFiles.zip file to a convenient location.

Microsoft MakeCode for

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

To solve a problem (perform a task) in a virtual world, we must accomplish the following:

VACUUM MARAUDERS V1.0

Using Bloxels in the Classroom

Tinker Tuesday Project - Fabric Engraving

Game Design Curriculum Multimedia Fusion 2. Created by Rahul Khurana. Copyright, VisionTech Camps & Classes

Game Maker: Platform Game

Programming I (mblock)

Defend Hong Kong s Technocore

The editor was built upon.net, which means you need the.net Framework for it to work. You can download that here:

Space Invadersesque 2D shooter

ArbStudio Triggers. Using Both Input & Output Trigger With ArbStudio APPLICATION BRIEF LAB912

1hr ACTIVITY GUIDE FOR FAMILIES. Hour of Code

Controlling a Sprite with Ultrasound

Transcription:

I. BACKGROUND 1.Introduction: GAME PROGRAMMING & DESIGN LAB 1 Egg Catcher - a simple SCRATCH game We have talked about the programming languages and discussed popular programming paradigms. We discussed in some detail three of the most popular paradigms: 1. Imperative (the intelligent list) a. Sequence b. Selection c. Repetition (Iteration) 2. Procedural (making calls) 3. Object Oriented ( a program as a group of interacting objects) Today you will create a simple game in Scratch using the concepts behind these paradigms. II. PLANNING THE GAME 1.Description of Game: (Never start a game by sitting down and coding. Every large programming project needs to be planned out, in as much detail as possible BEFORE you start coding. The more time, effort and detail you put into your planning stage, the faster the coding of the game will actually go.) The game will be called Egg Catcher. In the game a cat (the player) will attempt to catch the eggs that are dropped by a flying parrot. The player will control the cat using the mouse. In the first iteration of the game (what this tutorial covers), we will have the parrot drop one egg over and over. Each egg that is caught will add one to the score. If an egg makes it to the bottom of the screen the game is over. 2.Programming Outline Plan, plan, plan, before you write a single line of code! A programming outline will help you see problems, and help prevent you from making mistakes. Object (Name, Description) Stage (the stage itself, which will have a title and a gameplay screen). Cat (the player) Properties (What are the facts about this object? What does the object look like? How many images will you need for it? Where does it start? What are its states (alive, dead, etc.) Stage will have three backgrounds. Stage will have two variables: score which will be set to 0 at start. Will have two costumes so that it can appear to run. Functions (What does this object do? Can it move? Can it change costumes? Can it interact with other objects? Can it interact with the player?) Stage will show the title and instructions, switch backgrounds, broadcast a startgame message to start the actual game, and then finally switch backgrounds again when it receives the endgame message. The cat will move and change costume to follow the mouse on the screen. The cat will not go up and down only side to side. Page 1

Parrot (the opponent AI) Egg (will control score and end of game) Will have two costumes so that it can appear to fly. Has only one costume. Parrot will fly back and forth across the top of the screen. Will appear next to the parrot, then fall towards the bottom of the screen. If it touches the Cat the score will go up by 1. If it reaches the bottom of the screen the game will end. III. CREATING THE GAME 1.Creating the Objects: By looking at the programming outline, you should be able to see that we need four objects. In SCRATCH these objects are called Sprites. 1. Start a new game. This will give you two of the sprites you will need automatically: the Stage and Cat. 2. Create the three backgrounds for the Stage sprite: a. Select the stage, by clicking on the Stage icon in the Sprite window (lower right of screen). b. Click on the Backgrounds tab in the center of the SCRATCH Window. c. Rename the background that is already there (background1) to title. d. Click on the edit button underneath the title background. e. In the Paint Editor window that appears, select the Text Tool button in the left panel. f. Add the following text to the title window: Egg Catcher: Use the mouse to control the Cat, and catch the eggs. g. Click OK to save the edited window. h. Add a second background image by clicking on the Import button. I used the xy-grid. You can add whatever you want, just change the background name to playscreen afterward. i. Now add a third background image by clicking on the Paint button. g. In the Paint Editor window that appears, select the Text Tool button in the left panel. h. Add the following text to the title window: Game Over j. Click OK to save the edited window. k. Rename the background to game over. l. 3. Create the Parrot sprite, a. Click on the Choose New Sprite From File button (the middle button) in the sprite area. b. In the costumes folder click on the Animals folder, and then click on parrot1-a, and click OK. Page 2

c. With the new parrot sprite selected, click on the Costumes tab in the middle of the screen, you should see one parrot costume (parrot1-a). d. Add a second costume by clicking on the Import button. e. Choose the parrot1-b costume. f. 4. Create the Egg sprite. a. Click on the Choose New Sprite From File button (the middle button) in the sprite area. b. In the costumes folder click on the Things folder, and then click on beachball1 and click OK. c. 5. You should now have 4 sprites (including the stage) in the sprite area of the application. Page 3

6. You now need to add one variable to the game. 7. Congratulations, you have created the 4 sprites (objects) that you need! 2.Sequence The code in SCRATCH is put together using blocks from the library and is assembled in the Scripts area for each Sprite. The scripts that are created are read from top down once they are started. We need a script for the stage, that will initialize all of the variables to 0 (by convention, 0 means NO and 1 means YES), display the title screen, play a sound, wait 10 seconds, and then switch to the playscreen. Click on the stage icon in the sprites area, and then click on the Scripts tab in the center window. Then drag and drop the code blocks from the library on the left of the screen, until your script window looks like this: Page 4

Once your script looks like the example above, click on the green flag in the top right of the screen to test it. 3.Procedures (messages) We need a way for different objects to communicate with each other in the game. As an example, after the Stage sprite has switched to its playscreen background we would like it to send out a signal to all of the other sprites that the game can now start. Later we want the stage to switch to the game_over screen when it receives a message. Add the following code to your script in the Scripts window of the Stage sprite. Once your script looks like the example above, click on the green flag in the top right of the screen to test it. 4.User Interaction (the player). Select the Cat sprite. He needs to be put in his starting place and hidden when the green flag is clicked (that way he will not appear on the title screen). Then he needs to be appear, and start moving when the game actually starts. He will turn to face the mouse and make his X position match the mouse X position. Page 5

Once your script looks like the example above, click on the green flag in the top right of the screen to test it. 5.Repetition Select the Parrot sprite. She needs to be put in her starting place and hidden when the green flag is clicked. Then she needs to appear and move back and forth across the top of the screen, without leaving the screen. She should move very slowly at first (actually she will not move at all in the beginning) but then faster and faster as the game progresses. Page 6

Once your script looks like the example above, click on the green flag in the top right of the screen to test it. 6.Selection and Collision Detection The egg should start at the parrot, and then fall towards the bottom of the screen. It needs to be able to determine if it comes in contact with the Cat (add 1 to the score) and if it gets to the bottom of the screen (game over). Like the parrot, we want the egg to start off moving slow, but then get faster as the game progresses (but the egg will always be moving a negative amount in the y direction). Page 7

IV. Making the Game Better: What could be done to make this game better and more fun to play? Trying adding some more things to this game: - Add a difficulty setting. - Have the egg drop randomly. - Drop multiple eggs. - Add a start button after the Title Screen so that you do not have to wait 10 seconds. - Add a try again button on the game over screen. - Keep track of the players high score. - Add some more sounds (running, wings flapping, etc.) Page 8