1 / 60

Write Your First Computer Game!

Write Your First Computer Game!. Coding: Programming Languages. Just like you can speak Chinese to someone who understands C hinese to tell them what to do… A programming language tells a computer what to do!

jacie
Télécharger la présentation

Write Your First Computer Game!

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Write YourFirst Computer Game!

  2. Coding: Programming Languages • Just like you can speak Chinese to someone who understands Chinese to tell them what to do… • A programming language tells a computer what to do! • During this project, we will learn how to tell a computer how to make a fun game about a Tadpole and Frog!

  3. Big Ideas What is Coding? How Can you Write Code? What is Scratch?

  4. This is Scratch!

  5. To sign up: Go to http://scratch.mit.eduand click on Join Scratch

  6. Enter a username and password Use your Type2Learn username and password on the label

  7. Enter birth month and year, gender, country and e-mail Use this e-mail address

  8. Click on Let’s Go! Click on OK Let’s Go!

  9. Create a New Project Click on Create

  10. Title your project Title your project first name + last initial + 1

  11. Scratch: Stage Stage Like in real life, the stage is where the performance, or game happens!

  12. Scratch: Sprite Sprite Not the soda! An actor or a character that is on the stage, doing what you tell it to do!

  13. Scratch: Script Scripts This is where you tell your actor/sprite what to do!

  14. Delete the cat sprite First click on the cut tool Then click on the cat sprite

  15. Create a Sprite Let’s Get our Hero on Stage! Click here to find our tadpole!

  16. Create a Sprite Here is our tadpole. On stage, ready to respond to our commands!

  17. The Evil Fish Now lets’ get the evil fish on stage! Choose a sprite from the library!

  18. The Evil Fish Now lets’ get the evil fish on stage! Choose fish 2. He looks ready to eat!

  19. Ready for Instructions! Both our actors are on stage. Now we need to tell them what to do!

  20. But first, let’s put them in the water! We need the stage to look like a pond. So let’s do that… Choose a new backdrop!

  21. But first, let’s put them in the water! Choose “underwater” scene 1, 2, or 3! Nature Scenes

  22. Our Tadpole and Fish are in Water

  23. Let’s Start by Giving Evil Fish instructions Click on Evil Fish, so he knows we are telling him what to do. Click to make him active

  24. Scripts: Instructions to your sprites There are all sorts of script blocks. These blocks are instructions to tell your sprite what to do. We’ll start with “motion” blocks. Make sure “motion” is selected

  25. Make Evil Fish Move Forward! Point at “move” block and DRAG to the script area. Choose move 10 steps

  26. Nothing Happened! You have to TELLhim when to start moving! Clickon Events. Drag When [green flag] clicked onto your scripts area. Choose when green flag is clicked

  27. Move Blocks together to give instructions to your character Slide the blocks together! Now, the fish will move 10 steps when you click the green flag! Give it a try!

  28. Evil Fish Doesn’t Move Very Far Each click of the green flag moves him only 10 steps. Let’s make him keep moving! Keep pressing the green flag to see Evil Fish move 10 steps

  29. Make Evil Fish Swim Forever Go to the CONTROL area. These are blocks that let you CONTROL your sprites even more CONTROL options control what your sprites do

  30. Make Evil Fish Move Forever A Forever loop tells Evil Fish to do what is inside the loop FOREVER. Till the end of time. And then keep going! Choose Forever

  31. Make Evil Fish Move Forever A forever loop tells Evil Fish to move 10 steps FOREVER. Till the end of time. Give it a try! Forever loops tell your charater to do what you say forever and ever

  32. Uh-oh! He disappeared! Evil Fish disappeared. We have to tell him to stay on stage! If on edge, bounce

  33. Now he’s going only back and forth… lets’ have him turn Use the turn motion block to tell him to turn Turn right 15 degrees

  34. Now he’s spinning. Let’s randomize it! Random: let the computer pick a number! Let the computer choose a number to turn Evil Fish

  35. Lets do that with the steps too! This makes it harder to guess where Evil Fish will move next!

  36. Evil Fish is Ready for The Game! Let’s remember to tell Evil Fish to get on stage to start the game!

  37. Let’s Save our Progress! Enter a name for your game Then click SAVE NOW

  38. Time to Move The Tadpole First, we need to select the sprite we want to give instructions to. Click on the tadpole!

  39. Follow The Mouse! For Tadpole to escape the evil fish, we need to make her move by following the mouse pointer around.

  40. Follow The Mouse! For Tadpole to escape the evil fish, we need to make her move by following the mouse pointer around. Uh-oh. She stopped when he moved once. How do we make her always follow the mouse pointer around?

  41. Follow The Mouse! Now tadpole will follow the mouse pointer forever.

  42. Let’s Make it a Game! In order for a tadpole to grow into a frog, she needs to be able to avoid evil fish long enough to grow up! Let’s make it so that Tadpole has to stay away from Evil Fish for 20 seconds to become a frog!

  43. Adding Time to The Game First, click on your stage. We are going to now set controls for the whole game, not just our actors/sprites

  44. Adding Time to The Game When the flag is clicked, we want to wait 20 seconds then alert the game that the tadpole has won! From Control From Sensing

  45. Adding Time to The Game After 20 seconds goes by, we need to send off a broadcast, which tells all the actors to pay attention and do something special! From Events. Choose New Message Broadcast frog

  46. Adding Time to The Game When the actors hear the broadcast frog we need them all to do something! Tadpole should change into his frog costume. Evil fish should stop swimming because the game is over! When 20 seconds has gone by, all the actors will hear the message frog.

  47. Tell Tadpole She Won! Click back on Tadpole. Let’s have her respond to the frog broadcast. Click on Event and choose When I receive . . . Change this to be frog

  48. Make Tadpole Turn into a Frog! Tadpole needs to change into her Frog costume Click on New Costume and choose the Frog costume

  49. Make Tadpole Turn into a Frog! Choose Frog, click OK

More Related