Go to =>

Slides:



Advertisements
Similar presentations
Create a Simple Game in Scratch
Advertisements

Create a Simple Game in Scratch
Getting Started With Alice By Ruthie Tucker under the direction of Prof. Susan Rodger Duke University, July
Harry Potter Scratch Game
A Christmas Scratch game
Code Club Session 3 Shark Eats Fish. Picture of finished product here.
Drinks Bottle Using CREO DEVELOPMENT
Write Your First Computer Game!. Coding: Programming Languages Just like you can speak Chinese to someone who understands Chinese to tell them what to.
ABC’s of PowerPoint (Office 2007) Part 1: Basic Vocabulary Part 2: Cursors Part 3: Insert Your Text Part 4: Insert Your Pictures Part 5: Basic Tools &
Scratch Understanding some programming techniques using Scratch Resetting, Parallelism and Events.
Digital Art in Scratch part 1 Barb Ericson Georgia Tech Oct 2010.
Creating pong in scratch Learning objectives: To learn how to program Sensing via colour and sprite proximity O:\ICT\ks3\scratch\scratch Exercises\Creating.
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.
> 1 Diagrams in Word Faculty of Health Alan Grace.
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.
Using MIT Scratch for Programming and Control Exercise 6 – Creating a Scratch Packman Year 9 ICT Autumn Term 2007.
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.
2015 CSE/EGR Summer Camps 1 Computer Science Concepts 1. What is an algorithm? 2. Binary information coding 3. Programming concepts via Scratch Designed.
This is what we want to draw Extrude Mirror Round Edges.
1.To begin click: File, New, then select Design 2.Draw a circle, then use the dimension tool to set it’s size to 84 diameter or 42 radius. 3. Next draw.
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.
Creating a Simple Game in Scratch Barb Ericson Georgia Tech June 2008.
Making a Sprite Dance Barb Ericson Georgia Tech June 2011.
Learning PowerPoint Presenting your ideas as a slide show… …on the computer!
Create a Halloween Computer Game in Scratch Stephanie Smullen and Dawn Ellis Barb Ericson October 2008.
Tutorial for Arrays and Lists. Description This presentation will cover the basics of using Arrays and Lists in an Alice world It uses a set of chickens.
Variables and Random Numbers Computer App Session 4.
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.
2D Design – A Guide! SECTION 1.
Open a new Flash File Action Script 2.0. Create a button like you did last lesson and name it Click to Play.
Introduction to Computer Programming - Project 2 Intro to Digital Technology.
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.
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.
Computer Programming with Scratch JAOIT 8. Scratch Scratch is a programming language that makes it easy to create your own interactive stories, animations,
Creating a Simple Game in Scratch Barb Ericson Georgia Tech May 2009.
School of Computer Science Space School 2015 Programming a Lunar Lander Game.
Welcome to the Basic Microsoft Word Guide. Before you start this Guide, you will need to complete “Basic Computer”; “Basic Windows” and know how to type.
4. INPUTTING THE PART (DRUMS) MUSIC TECH. Make sure you have a blank part set up and the pointer icon selected. First you need to loop the part. Hover.
Review for Final June 13, 2016.
Scratch Programming Cards
Create a Halloween Computer Game in Scratch
Scratch for Interactivity
Exploring Mathematical Relationships Module 5: Investigation 3
Scratch Unit Overview We are going to look at computer programming and how to create your very own computer game The piece of software we will be using.
Scratch for Interactivity
Learning to program with Logo
Introduction to Object-Oriented Programming
Learn… Create… Program
Scratch – Simple Programming
Go to =>
Learn… Create… Program
Unit 11 – PowerPoint Interaction
Introduction to TouchDevelop
Using the sensor Lesson 5.
Go to =>
Go to =>
Getting Started With Alice
Recording and editing a Podcast
Learn… Create… Program
Learn… Create… Program
Creating a Simple Game in Scratch
Lesson Nine Variables.
Presentation transcript:

Go to => http://scratch.mit.edu/scratch_1.4/ Install Scratch Go to => http://scratch.mit.edu/scratch_1.4/

Today we will work on changing costumes Today we will work on changing costumes. Start by clicking on ‘costumes’. We only need the top one so click on the ‘X’ next to the bottom cat to delete it. Please note - The design and idea for this game are borrowed from Al Sweigart http://scratch.mit.edu/projects/11629018/ (big thank you)

Click on ‘edit’ and move the cat up to the top of the screen using the scroll bar on the right.

Select the circle and draw a flat circle under the cat. Start by the arrow on the left and press and hold the left mouse button. Move down to the arrow on the right and let go. If you get it wrong click ‘undo’ and try again.

Click ‘Copy’ 4 times so we end up with 5 cats Click ‘Copy’ 4 times so we end up with 5 cats. If you do it too many times click the ‘X’ to remove the spare ones.

Click ‘save’ icon and type in a name. Lets call this one Whack-a-Cat It is a good idea to save your game now and then so you can always go back if it gets messed up or even goes wrong and crashes. Click ‘save’ icon and type in a name. Lets call this one Whack-a-Cat

Click on the top cat and click ‘edit’. Click on the ‘select tool’. This will allow us to draw a box round an area we are interested in changing.

Draw a box round all of the cat but NOT round the circle. If it goes wrong - click on the tool again and you can try again. If it really goes wrong click ‘undo’.

Press the DEL key on your keyboard. If it goes right and looks like this press OK. If it goes wrong - hit cancel and then try again.

Select the 2nd cat and click edit. This time start your selection a little lower - just below the ears. Hit delete again so we just have his ears left.

Now click the select tool again and drop a box round the ears. Do not press delete this time - we want to keep the ears

When you put the mouse over the middle it turns into a little hand. When it looks like that hold down the left mouse button - now you can move the ears.

Drop the ears inside the black circle and click OK

Lets Save it again

Edit the 3rd cat and start a bit lower Edit the 3rd cat and start a bit lower. Delete the bottom part - myabe just above his neck. and then highlight the top part of the head and drag it downwards.

You should end up with something like this. Click OK when you are done. Click cancel if it goes wrong.

Edit cat 4 and repeat the process again Edit cat 4 and repeat the process again. This time cut him in half somewhere round his waist. After you move it, he should look like this :

Edit cat 5 and make it look like this :

Your 5 costumes should now look like this :

Next copy number 3 and then number 2. You do not need to do number 1’ Click on ‘copy’ next to cat 4 and it will make a new one called number ‘6’ Next copy number 3 and then number 2. You do not need to do number 1’ You should end up with 8 costumes.

Lets Save it again

Click on scripts and then on the control button. Lets start coding. Click on scripts and then on the control button. You now start picking up commands on the left and dropping them on the blank script area in the middle. Start with ‘When green flag is clicked’

Next select the ‘looks’ button and add ‘switch to costume 8’ After you add it, click on the little arrow next to to costume 8 and pick costume 1 from the drop down list.

Next we are going to add a forever loop. You will find this in the ‘control’ section. A Loop means repeat the commands inside the gap over and over and over and over again….

Now click on the ‘looks’ button and add in 8 ‘next costume’ command. Drag them inside the forever loop.

Lets test. Click on the green arrow to start and the red blob to stop. What does it do ?

Back to control again. Drop in a ‘wait 1 sec’ commands in above each ‘next costume command’ You will need 8 of them.

Test again. Is it right this time ?

I think the cat is moving a bit slow. Click on the ‘1’ and change it to ‘0.2’ work down the list changing all of them.

Test again. Is it right this time ?

You only need this on the top one. In Operators (the green button) pick up ‘pick random 1 to 10’ and drop it on the top wait so it goes over the number. You only need this on the top one.

Lets add a new sprite - this time we will draw it.

Pick the square tool and pick a colour Pick the square tool and pick a colour. I’ve done the hammer handle brown and then done the other black :

Now we need to add some code to make out hammer work :

and another bit of code to make the hammer move when you press the SPACE bar

It goes down…. but we need it to go back up again It goes down…. but we need it to go back up again. Lets add some moves in the other direction.

Test it. Hmmmm - now it is so fast you cannot even see it Test it. Hmmmm - now it is so fast you cannot even see it. lets slow it down a bit. make sure the number for each ‘wait’ command say 0 . 05

and to finish it off lets add a noise and to finish it off lets add a noise. You will find the noises under the ‘sound’ section on the left. It goes in right under the third ‘turn’ command.

Test it again. Maybe we need something to happen when the hammer hits the cat ?

Break time… take 5 minutes. Rest your eyes, legs, fingers and all that. Have a drink and a snack - keep up the energy levels - we have a LOT more work to do...

We need to add some Variables We need to add some Variables. You find these by clicking on the ‘Variables’ button and then ‘make a variable’

Lets add one called ‘score’ (with the dot in ‘for all sprites’)

..and another called ‘time’ (again with the dot in ‘for all sprites’)

This time change the dot to ‘for this sprite only’ Make sure the cat is selected in the bottom right corner and then add another variable called cat-up. This time change the dot to ‘for this sprite only’

Untick the cat-up variable so it does not show up on the screen. (click it on and off a few times so you can see what this does)

Last one… Click on the hammer and then make a variable again. Call this one ‘hammer-time’ and leave the dot on ‘for all sprites’ Untick this one so it does not show up on the screen.

You should currently have something like this :

Click on Sprite 1 - The cat. Now lets build up the main game ‘loop’. This will control what happens in the game. Click on Sprite 1 - The cat. Start by building this (all from the control area) :

Go to the ‘operators’ area and get an ‘and’ command Go to the ‘operators’ area and get an ‘and’ command. Now get another one - we will need two of them for this. ‘and’ does exactly what it sounds like. Do something if this AND that happen.

Now go to ‘sensing’ and find ‘touching’ command at the top of the list Now go to ‘sensing’ and find ‘touching’ command at the top of the list. Drag it out and then click the drop down arrow and pick ‘sprite 2’ (which should be the hammer) When you have it set drop it in the first ‘and’ box

We need another couple of bits to make this all work We need another couple of bits to make this all work. Go to ‘operators’ and drag out two of the ‘=’ signs. This is a bit complex - it will make sense in a few minutes (honest)

Click on the Variables button on the left and make sure the cat is selected on the right. Now pick up the names of the new variables you made ‘cat-up’ and ‘hammer-time’ and drop them in these boxes :

click on each white box and add the word ‘yes’

Pick up both of them (put the mouse on the ‘=’ sign and grab there Pick up both of them (put the mouse on the ‘=’ sign and grab there. It makes it easier). Drop them into the two holes on the second green thing. Wait until you see a glowing white things in the right place and then drop.

Now drop this into the hole in the first one Now drop this into the hole in the first one. Pick up by clicking on the ‘and’ and the left hand side is the bit that will get the white glow so aim the very left hand side into the box and then drop.

And we drop all of that ‘thing’ we just made into the ‘if’ loop What does it mean ? If we are touching the hammer and cat is up It is hammer time (the hammer is swinging) ...then....... what would happen ?

What happens ? The cat says ‘Ouch !’ and the score goes up by 1 (‘say’ is in looks and ‘change’ is in variables or data)

You’ll find them in ‘variables’ (or data). In Sprite1 (the cat) we need to add some code to the big loop so we know when the cat is up or down You’ll find them in ‘variables’ (or data). Drag them to just under the ‘wait line’ and to the bottom of the loop and set the name to ‘cat-up’ and the values to ‘yes’ and ‘no’

and in the hammer sprite code area we do the same for ‘hammer time’ get them in the right places :

Still under the hammer sprite - lets make it move Still under the hammer sprite - lets make it move. You already have a small bit of code - add this to the bottom of it : (the goto x:y: bit is in ‘motion’)

and then stick it all together : get ‘mouse x’ and ‘mouse y’ from ‘sensing’ and put them into the holes. and then stick it all together :

Last step (honest) We just have to get the time bit working… On the cat (sprite 1) get a ‘greater than’ (>) sign in the operations area and add ‘time’ into it from variables. Make the other box say zero and put it in place in the forever loop

Click on the stage icon (the white box). Add in this code to make the time count down

Right click on the cat sprite (on a mac press CTRL and click) and select duplicate sprite. Make 7 or 8 of them and move them on the screen :

What have we used today ? Loops Variables ‘If’

Thats it - you have just coded your first game. Does that make you a CoderDojo Ninja ?

No.

A CoderDojo Ninja is someone who takes it further and makes it into their own unique game. Some ideas : * Different graphics for the cat ? * Sound FX - make better NOISE !!! * How about a background ? * Better hammer ? * What about moving the holes ? * and most important… add your own ideas...

Did you miss any steps ? This presentation is available on our website : www.donabateDojo.com Click on ‘lessons’

The Donabate Dojo Mentor team. Please note - The design and idea for this game are borrowed from Al Sweigart http://scratch.mit.edu/projects/11629018/ (big thank you) Also a big thank you to The Donabate Dojo Mentor team. The Community Centre for the room and setting it up. The mums and dads and adults for transport and help and most of all - Thank you to our new Ninjas (thats you) Comments, suggestions, donations, questions to : email : team@donabateDojo.com Facebook : www.facebook.com/DonabateDojo Twitter :@DonabateDojo Website : www.donabateDojo.com