1 / 14

Scratch

Scratch. More complex scratch. Lesson Objectives. Understand the concept of a variable Using the random function Move towards Keep track of score using a variable. Setting up the need for a variable. Before we learn about variables we must create the “need” for them!

jovan
Download Presentation

Scratch

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. Scratch More complex scratch

  2. Lesson Objectives Understand the concept of a variable Using the random function Move towards Keep track of score using a variable

  3. Setting up the need for a variable Before we learn about variables we must create the “need” for them! First of all we will create a baddie which will move towards the player

  4. Move towards Baddie moves towards pucman until they touch That is game over! Otherwise it points towards him And moves slowly!

  5. Activity Add a baddie and make it move towards pucman. Use collect version 1 to help you

  6. Items reappears! Forever will keep looping, err, forever! It will repeat whatever is inside it When collected it will move to a new postion

  7. Random position Pick random (under operators) allows you to pick a number between a set of values. This allows you to pick a new X and Y position for your item!

  8. Activity Get your item to move once collected!

  9. Variables A variable is something which can change! It must have a name (so we can refer to it) And a value! The value can change over time and can be checked In a loop or a if statement A score will be a variable

  10. How a score will work Initially set to 0 on game start When a item is picked up it will increase by a set amount On game over it will be displayed!.

  11. Adding a score Click on make a variable Call it score! You should see the options shown on the right

  12. Setting score to zero This script should be added to the player.

  13. Item code The item needs to change the score. This is added to the item's code as shown below.

  14. Activity Add score to your game. If your feeling adventurous. Open up collect version 2. See how it works Add it to your game!

More Related