Creating a Simple Game in Scratch Barb Ericson Georgia Tech June 2008.

Slides:



Advertisements
Similar presentations
Sprite-visual object (actor on the stage) Scripts- Tells actors (sprites) what to do.
Advertisements

Create a Simple Game in Scratch
SimpleGameInAlice1 Barb Ericson Georgia Institute of Technology June 2008 Creating a Simple Game in Alice.
Mike Scott University of Texas at Austin
Create a Simple Game in Scratch
Scratch is a Visual Programming Language
30 min Scratch July min intro to Scratch A Quick-and-Dirty approach Leaving lots of exploration for the future. (5 hour lesson plan available)
Mission Technology Introduction to Scratch! June 2007.
Scratch for Storytelling Dr. Ben Schafer Department of Computer Science University of Northern Iowa.
Pong! “The oldest commercially available game in history” Resources created from the video tutorials provided by David Phillips on
Harry Potter Scratch Game
Adventures in Animation Harry Potter Game Pranali Choubal Kunal Shaw Barb Ericson Dec 2007.
A Christmas Scratch game
Code Club Session 3 Shark Eats Fish. Picture of finished product here.
This game is loosely based on the Whack-A- Mole arcade game.  Each game starts with 45 seconds of play.  Moles randomly pop out of holes on the landscape.
Write Your First Computer Game!. Coding: Programming Languages Just like you can speak Chinese to someone who understands Chinese to tell them what to.
Mrs. Chapman. Tabs (Block Categories) Commands Available to use Script Area where you type your code Sprite Stage All sprites in this project.
ITEC Winter An intro to programming concepts with Scratch Quick intro for college citizens. George Stockman MSU CSE.
Extending the Pong Example Barb Ericson Georgia Tech June 2011.
Digital Art in Scratch part 1 Barb Ericson Georgia Tech Oct 2010.
Adventures in Animation Introduction to Scratch! Michelle Venable-Foster June 2006.
Mr. Wortzman. Tabs (Block Categories) Available Blocks Script Area Sprite Stage All sprites in this project.
Fish Chomp. The screen where you can see what happens when you play your game is called the STAGE. The SCRIPT BANK is where the types of instructions.
Scratch the Cat. Object Oriented Programing Writing computer programs Based on Objects Instead of Actions Based on Data Instead of Logic.
Code Club Session 2 Dance Party. What will we learn ?  How to change the background  How to create animations  How to make objects talk to each other.
Introduction to Scratch!
Making a Boat Racing Game in Alice By Jenna Hayes Under the direction of Professor Susan Rodger Duke University, July 2010.
Using MIT Scratch for Programming and Control Exercise 3 Ball Game Year 9 ICT Autumn Term 2007.
We will be creating a spaceship that simulates real movements in space. The spaceship will fire a laser beam that can destroy targets. The spaceship will.
Introducing Scratch the Cat
Objects and Methods in Scratch 1. 2 Scratch environment Stage is at upper right (where actors act and information is displayed) Sprite is another name.
How to make a Shooting Target game in Scratch!. WE ARE GOING TO MAKE A TARGET GAME. This game will have: A Target that will move when clicked. A Timer.
Geometry. The screen where you can see what happens when you play your game is called the STAGE. The SCRIPT BANK is where the types of instructions are.
Digital Art in Scratch part 1 Barb Ericson Georgia Tech May 2011.
Fish Chomp. The screen where you can see what happens when you play your game is called the STAGE. The SCRIPT BANK is where the types of instructions.
Making a Sprite Dance Barb Ericson Georgia Tech June 2011.
Create a Halloween Computer Game in Scratch Stephanie Smullen and Dawn Ellis Barb Ericson October 2008.
Computer Programming Modeling a Passive Solar Home.
Variables and Random Numbers Computer App Session 4.
Drawing with the Pen Barb Ericson Georgia Tech June 2011.
Marble Racer. The screen where you can see what happens when you play your game is called the STAGE. The SCRIPT BANK is where the types of instructions.
How to create a sprite Delete a sprite (e.g. the cat) by right clicking on it and choosing delete. Go to the bottom right hand corner and choose a new.
How to create a sprite Delete a sprite (e.g. the cat) by right clicking on it and choosing delete. Go to the bottom right hand corner of the stage and.
Using MIT Scratch for Programming and Control Exercise 4 – Cat and Dog game Year 9 ICT Autumn Term 2007.
Welcome to Scratch By Miss Key. The Main Screen Viewing screen with choice of views.
Scratch for Interactivity Dr. Ben Schafer Department of Computer Science University of Northern Iowa.
How to create a basic game in Scratch. The Scratch Stage The Scratch stage is 480 pixels wide and 360 pixels high x increasesx decreases.
Adventures in Animation Introduction to Scratch! Michelle Venable-Foster Barb Ericson Dec 2007.
1 CSC 221: Computer Programming I Fall 2009 Introduction to programming in Scratch  animation sprites  motion, control & sensing  costume changes 
Computer Programming Modeling a Passive Solar Home.
Madlib-Input, Strings, and Lists in Scratch Barb Ericson Georgia Tech.
Computer Programming with Scratch JAOIT 8. Scratch Scratch is a programming language that makes it easy to create your own interactive stories, animations,
Teaching Kids Programming with Chromebook Digital Convergence Lab, NIU.
Creating a Simple Game in Scratch Barb Ericson Georgia Tech May 2009.
Introducing Scratch Learning resources for the implementation of the scenario
Game Maker Tutorials Introduction Clickball IntroductionClickball Where is it? Shooting Where is it?Shooting.
Create a Halloween Computer Game in Scratch
Scratch for Interactivity
Scratch for Interactivity
Scratch Programming Intro
Go to =>
Scratch for Storytelling
Go to =>
Creating a Simple Game in Scratch
CSC 221: Introduction to Programming Fall 2018
Catch Game Cards Catch Game Cards Make a Card Go to the Top Fall Down
Presentation transcript:

Creating a Simple Game in Scratch Barb Ericson Georgia Tech June 2008

Start up Scratch Click on Scratch.exe

The Scratch Stage The Scratch stage is 480 pixels wide and 360 pixels high ,0 at the center of the stage

Delete the Cat Right click on the cat and pick delete Or click on the cat to select that sprite and then click on the scissors to delete it

Add the Baby Click on the folder with a star in it –if you hover over it, it says "Choose new sprite from file"

Select the People Folder

Scroll to the Baby Click on the baby and then OK

Resize Your Sprite! You can make your sprite larger or smaller by using the “grow sprite” or “shrink sprite” icons. You click on one of these icons, then click on your sprite until it is the size you’d like. shrink grow

Move the Baby Select (click on the arrow and then on the baby) and click and drag the baby to the bottom of the window

Respond to Arrow Keys Click on Control (orange) and then drag out "when space key pressed"

Respond to Right Arrow Click on down arrow next to space and select right arrow Click on Motion (blue) and drag out a "move 10 steps"

Change the move amount Click on the 10 –it will highlight in blue Type 5 and press enter

Respond to Left Arrow Click on Control (orange) Drag out a "when space key pressed" Change "space" to "left arrow" Click on Motion Drag out a "move 10 steps" Change it to -5 (to move left) Try out the left and right arrow keys –Does the baby leave the window?

Paint a Ball Click on the paint brush and star –It will say "Paint new sprite" if you hover over it

Use the Paint Editor Click on the Ellipse tool

Select a Color

Draw the Ellipse Click and drag to create the ellipse Then click on "OK"

Move the ball to the top Click and drag the ball to the top of the window

Make the Ball Fall When the green flag is clicked we want the ball to start at the top and fall down –Click on Control (orange) –Drag out a "When green flag clicked"

Start the Ball Click on Motion (blue) Drag out go to x # y # –this will always start the ball at the current position Drag out a "point in direction 90" –and change it to 180 (down)

Make the ball fall Click on Control (orange) –drag out a "forever" Click on Motion (blue) –drag out a "move 10 steps" change it to 1 step Try it out!

Catch the ball! If the distance from the center of the ball to the baby is less than the half the size of the ball then it is caught Let's track how many balls we have caught with a score

Track the score When we start the game set the score to 0 Click on Variables (red) Click on Make a Variable Name it score

Set score to 0 Drag the forever down Drag out a "set score to 0" Notice the score showing on the window

Did we catch the ball? From Control drag out an if We will check if the distance to the baby is less than half the ball size Click on Number (green) and drag out a "blank < blank"

Distance to baby Click on Sensing (light blue) Drag out a "distance to blank" Change it to sprite1

Half the Size of the Ball Click on Number –Drag out a "blank / blank" –From Looks drag out a size –Type on second blank and type 2

Increment the score Click on Variables –drag out a "change score by 1" Try it out! –is this what you expected?

Reset the ball Once you catch the ball –move it back to the top of the window –this time to a random x value between the left edge and right edge –Click on Motion and drag out a "go to x # y #"

Pick a random X value Click on Number –drag out a "pick random 1 to 10" –drop on the x value –change the 1 to -235 and change 10 to 235 –change the y value to 161

Adding Losing If the baby doesn't catch the ball it just gets stuck at the bottom of the screen Let's tell the player that he or she lost

Add text sprite Click on the Paint new sprite button –Click on the T for text –Move the square to where you want the text –Type You Lost!

Hide the sprite Click on Control –drag out "when green flag clicked" Click on Looks –drag out hide

Check if lost If the ball hits the bottom of the window –the player has lost Click on Control –drag out an if

Check if at bottom Click on Numbers –Drag out a "blank < blank" Click on Motion –drag out a "y position" Click on the last blank –type in -175

Broadcast a message Sprites communicate by passing messages –One sprite broadcasts the message –Other sprites can listen for it and react to it when they receive it –Click on Control drag out "broadcast blank" click on new – name it lost add a stop script tile –to stop the forever loop

Receive Lost Click on the text sprite Click on Control –drag out "when I receive blank" –click on the down arrow and select lost Click on Looks –drag out show Click on Control –drag out stop all to stop all scripts

Record a Sound Click on the ball sprite Click on the Sounds tab Click the Record button –Click the red circle to start –Click the black square to stop –Play with the right arrow

Name the sound Click in the sound name area and rename it

Play the Sound Click on Sound –drag out "play sound pop" –drop after increment the score –change pop to yum

Add a Background Click on stage Click on the Backgrounds tab Click on import Select a new background

Create Instructions Click on the Show Project Notes in the upper right corner Add the author and instructions

Share your game You can share your projects at the scratch web site – Click on the Share! button You can also download other projects and see how they were created

Other Ideas Add a sound when you lose –You may need to add a "stop script" to the script for the ball after you send the lost message Only catch the ball in the baby's mouth Add the ability to win –When you reach a certain score –Track the amount of time it takes as well Speed up the ball over time Add more sprites to catch Add a sprite to avoid –killer sprite

Concept Summary Variables –can hold values and can change value Forever loops –repeat all the commands inside of them one at a time until the script is stopped Conditionals – ifs –only execute the body of the if when the condition is true Sprites can pass messages –and receive them Sprites can react to events –like clicking the green flag and pressing the left or right arrow keys Sprites can have several scripts, costumes, and sounds