• Share
  • Email
  • Embed
  • Like
  • Save
  • Private Content
Forest archery game
 

Forest archery game

on

  • 390 views

 

Statistics

Views

Total Views
390
Views on SlideShare
305
Embed Views
85

Actions

Likes
0
Downloads
0
Comments
0

1 Embed 85

http://vle.cardinalallen.co.uk 85

Accessibility

Categories

Upload Details

Uploaded via as Microsoft PowerPoint

Usage Rights

© All Rights Reserved

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Processing…
Post Comment
Edit your comment
  • If score greater than 1 – should be set to 0 One of the mouse x – should be set to mouse y The second change score should be set to -1 that than +1

Forest archery game Forest archery game Presentation Transcript

  • Forest Archery Game
  • Forest Archery Game http://scratch.mit.edu/tags/view/shooting Starter Activity: Target Games Check out the target style games:
  • Forest Archery Game In this lesson you will learn how to use random numbers, variables and collision detection. You will create an archery style target game. Lesson  Become more familiar with translating an algorithm into code  Understand the use of variables  Use if …else conditional statements Objectives
  • Watch the video Forest Archery which is in the programming in scratch folder in Groupwork to learn how to create a target game. Forest Archery Game
  • Task 12: Designing the Solution Think about the two main things that you will need to code: 1. moving the target 2. hitting the target Code your program from the algorithms on the next two slides. If you get struck, look back at the video. Forest Archery Game
  • Algorithm to move target (in Target sprite) when flag is clicked repeat forever glide in 1 second to a random position* * x is a random number from -240 to 240 y is a random number from -180 to 180 Forest Archery Game
  • Algorithm to move sight and fire (in Sight sprite) when flag is clicked repeat forever go to mouse location (the mouse x and mouse y positions) if the mouse button is down (the user has clicked the mouse) if the sprite is touching the target sprite add 1 to score variable play Pop! sound Say “Hit!” for 0.5 seconds Forest Archery Game
  • Task 13: Hit and Miss Change your program to so it takes 1 point off the score every time a player misses! If touching target change score by 1 play Pop! sound Say “Hit!” for 0.5 seconds else change score by -1 play Plunge! sound say “Miss!” for 0.5 seconds Forest Archery Game You have already programmed this section
  • Task 14: Stay Positive! Adapt the program so that the player will never get a negative score. In order to achieve this you will change your program so that points are only taken away when the players score is above zero. Forest Archery Game
  • Task 15: Bullseye! Using if and touching colour blocks, change the program so that when the target is hit, it adds the following to the score: •Gold - 5 points (and says “Bullseye!”) •Red - 4 Points •Blue - 3 Points •Black - 2 Points •White - 1 Point Forest Archery Game
  • Variables In this game, you used a variable block to keep track of the score. A variable is a space in a computer’s memory where you can hold information used by your program – just like storing things in a box. Once a variable is created, the information stored inside it can be set or changed (that is, varied – hence the word “variable”). Forest Archery Game
  • Plenary Question 1 Look at the adjacent script. The programmer has made 3 errors. Can you identify them? 1. 2. 3. Forest Archery Game
  • Forest Archery Game Keywords  Understand the use of an algorithm to develop a solution to a problem  Translate an algorithm into code  Use conditional statements Objectives  Collision  Variable  Random  Repeat  Forever  Touching  Value  Nesting   