1 / 8

Sensing and Variables

Sensing and Variables. Learning Objective. “Learn how to sense events and keep score”. Write this Learning Objective onto Page 1 of your workbook. Friday, 20 February 2009. Sensing. Sensing can be used to detect when something has happened in a game. Like touch in this example:.

afram
Download Presentation

Sensing and Variables

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. Sensing and Variables

  2. Learning Objective • “Learn how to sense events and keep score”. • Write this Learning Objective onto Page 1 of your workbook. Friday, 20 February 2009

  3. Sensing • Sensing can be used to detect when something has happened in a game. Like touch in this example: Is shark touching fish? No Yes Add to score. Learn how to sense events and keep score.

  4. Variables • Variables are used to store data. • In order for a game to “remember” what a players score is it must store it in a variable. Think of variables as boxes to store data which can be retrieved later. PLAYER NAMES LIFE SCORE Learn how to sense events and keep score

  5. The Game • Use the instructions on page 10 of your workbooks to create this Shark Attack game: Score shown here. Shark will move up and down using  cursor keys. Fish will start in a different place each time. Learn how to sense events and keep score

  6. Extension Task • Make your game better by adding some more features: • Change the sharks costume so it closes it’s mouth to eat the fish. • Add a GAME OVER stage to be displayed if the fish doesn’t get eaten. Learn how to sense events and keep score

  7. Learning Objective • “Learn how to sense events and keep score”. • Put  or  onto your Self Assessment page to show whether or not you have achieved today’s learning objective. Friday, 20 February 2009

  8. What can you remember? • What do X and Y mean when talking about the position of a sprite? • What is a variable used for? • What does broadcast mean? Learn how to sense events and keep score

More Related