SlideShare une entreprise Scribd logo
1  sur  20
A Mazing Game
Starter Activity: Maze Games
Check out the maze style games:
http://scratch.mit.edu/tagged/shared/maze
A Mazing Game
A Mazing Game
In this lesson you will use algorithms to help code
a solution that uses conditional statements to
make a program loop. You will create a maze style
game.
Lesson
 Understand the use of an algorithm to develop a
solution to a problem
 Translate an algorithm into code
 Use conditional statements
Objectives
Introduction
You are going to create a simple game where the
player guides an ‘explorer’ character around a
maze using the arrow keys.
The game will end when the explorer rescues its
friend in the middle.
A Mazing Game
Watch the video Maze which is in the
programming in scratch folder in Groupwork to
learn how to create the game.
A Mazing Game
Task 6: Setting the Scene
Set up the game by importing the stage costume
(Maze) and two sprites – an explorer and a friend
for the explorer to rescue.
N.B The maze is already in the backgrounds folder
Don’t do any more at this point.
A Mazing Game
The Importance of Design
Before you make anything – a house, a car or a
computer program – you should start with a
design.
There are two important parts to most programs
– the interface (how it looks) and the code – you
design these separately.
A Mazing Game
The easiest way to design the interface is by
sketching it out on paper.
To design the code, the easiest way is to write out a
list of steps you want the code to perform in
English. This is known as an algorithm.
Algorithms let programmers concentrate on what
the code has to do, instead of how to do it on the
computer.
A Mazing Game
Designing the Solution
Think about the two main things that you will
need to code:
1. Moving the explorer around the maze
2. Getting the explorer to rescue its friend
The table on the next slide shows an algorithm for
moving the explorer around the maze and the
Scratch code that does the same thing.
A Mazing Game
Algorithm for moving explorer Code
when the flag is clicked
repeat forever
if right arrow key is pressed
point right
move 5 steps
if left arrow key is pressed
point left
move 5 steps
if up arrow key is pressed
point up
move 5 steps
if down arrow key is pressed
point down
move 5 steps
if explorer touches the same
colour as the maze wall
Task 7: Moving the Explorer
Using a combination of the algorithm and the code,
develop your game so that you are able to move the
explorer around the maze.
Use of the video is forbidden from this point
onwards.
A Mazing Game
Algorithm for moving explorer Code
when the flag is clicked
repeat forever
if right arrow key is pressed
point right
move 5 steps
if left arrow key is pressed
point left
move 5 steps
if up arrow key is pressed
point up
move 5 steps
if down arrow key is pressed
point down
move 5 steps
if explorer touches the same
colour as the maze wall
Test your game to see if it works
If it doesn’t see if you can identify the problem.
A Mazing Game
Task 8: Rescuing the Explorers Friend
From this algorithm, see if you can create the code
for the friend sprite!
A Mazing Game
Algorithm for reaching centre of maze Code for friend sprite
when the flag is clicked
show sprite
repeat forever
if touching explorer sprite
say “Thank you!”
hide sprite
stop all scripts
Code this one
yourself!
Test your game to see if it works
If it doesn’t see if you can identify the problem.
A Mazing Game
Plenary: Question 1
A programmer creates a
maze game like the one
you’ve just created.
Unfortunately, the
character doesn’t move
as expected.
What mistake has the
programmer made?
A Mazing Game
Plenary:
Look at the two
examples of
code.
Do they
perform the
same task?
A Mazing Game
Question 2
Plenary: Question 3
The code adjacent controls a sprite
going round a maze. If the sprite
touches the side of the maze (the
colour blue), it returns to its starting
position of -150, 150.
Unfortunately, the sprite sometimes
touches the walls of the maze and
returns to the start when the player
doesn’t expect.
What mistake has the programmer
made?
A Mazing Game
Plenary: Question 4
In this example, the sprite is
supposed to return to the centre
of the maze when it touches the
sides (coloured blue); however,
it only does this sometimes.
What mistake has the
programmer made?
A Mazing Game
A Mazing Game
Keywords
 Understand the use of an algorithm to develop a
solution to a problem
 Translate an algorithm into code
 Use conditional statements
Objectives
 Loop
 Sprites
 Interface
 Code
 Indented
 Conditional Statements
 Collision Detection
 Repetition




Contenu connexe

Tendances (9)

Educational game pitch
Educational game pitchEducational game pitch
Educational game pitch
 
Snake game implementation in c
Snake game implementation in cSnake game implementation in c
Snake game implementation in c
 
OGDC 2014_One-Man Studio: How to make a game prototype_Mr. Le Vo Tien Giang
OGDC 2014_One-Man Studio: How to make a game prototype_Mr. Le Vo Tien GiangOGDC 2014_One-Man Studio: How to make a game prototype_Mr. Le Vo Tien Giang
OGDC 2014_One-Man Studio: How to make a game prototype_Mr. Le Vo Tien Giang
 
Reserach on porgrammign 8 bit
Reserach on porgrammign 8 bitReserach on porgrammign 8 bit
Reserach on porgrammign 8 bit
 
OGDC 2014: One-Man Studio: How to make a game prototype
OGDC 2014: One-Man Studio: How to make a game prototypeOGDC 2014: One-Man Studio: How to make a game prototype
OGDC 2014: One-Man Studio: How to make a game prototype
 
Cristian galliano presentation
Cristian galliano  presentationCristian galliano  presentation
Cristian galliano presentation
 
5. pre production(2)
5. pre production(2)5. pre production(2)
5. pre production(2)
 
5.pre production
5.pre production5.pre production
5.pre production
 
Computers of the Future
Computers of the FutureComputers of the Future
Computers of the Future
 

En vedette (6)

EDUCON16 "Comparing Computational Thinking Development Assessment Scores with...
EDUCON16 "Comparing Computational Thinking Development Assessment Scores with...EDUCON16 "Comparing Computational Thinking Development Assessment Scores with...
EDUCON16 "Comparing Computational Thinking Development Assessment Scores with...
 
The Digital Media Habits and Attitudes of Southeast Asian Consumers, October ...
The Digital Media Habits and Attitudes of Southeast Asian Consumers, October ...The Digital Media Habits and Attitudes of Southeast Asian Consumers, October ...
The Digital Media Habits and Attitudes of Southeast Asian Consumers, October ...
 
Scratch and pair programming
Scratch and pair programmingScratch and pair programming
Scratch and pair programming
 
Scratch Lesson 3
Scratch Lesson 3Scratch Lesson 3
Scratch Lesson 3
 
Scratch Lesson 1
Scratch Lesson 1Scratch Lesson 1
Scratch Lesson 1
 
Scratch Lesson 2
Scratch Lesson 2Scratch Lesson 2
Scratch Lesson 2
 

Similaire à A mazing Game

4.3 collision detection
4.3   collision detection4.3   collision detection
4.3 collision detection
allenbailey
 
A Breath From Earth - Gameplay Instructions (Imagine Cup 2009)
A Breath From Earth - Gameplay Instructions (Imagine Cup 2009)A Breath From Earth - Gameplay Instructions (Imagine Cup 2009)
A Breath From Earth - Gameplay Instructions (Imagine Cup 2009)
Sonny Brabez
 

Similaire à A mazing Game (20)

Scratch parrot shoot game
Scratch   parrot shoot gameScratch   parrot shoot game
Scratch parrot shoot game
 
Scratch Parrot Game
Scratch Parrot GameScratch Parrot Game
Scratch Parrot Game
 
intern.pdf
intern.pdfintern.pdf
intern.pdf
 
Pong
PongPong
Pong
 
4.3 collision detection
4.3   collision detection4.3   collision detection
4.3 collision detection
 
John Romero - The Early Days of Id Software: Programming Principles - Codemot...
John Romero - The Early Days of Id Software: Programming Principles - Codemot...John Romero - The Early Days of Id Software: Programming Principles - Codemot...
John Romero - The Early Days of Id Software: Programming Principles - Codemot...
 
Work Flow for 2D Game
Work Flow for 2D GameWork Flow for 2D Game
Work Flow for 2D Game
 
An introduction to coding
An introduction to codingAn introduction to coding
An introduction to coding
 
Lesson-1-Hack-Attack.pptx
Lesson-1-Hack-Attack.pptxLesson-1-Hack-Attack.pptx
Lesson-1-Hack-Attack.pptx
 
Games User Research is for Game Design!
Games User Research is for Game Design!Games User Research is for Game Design!
Games User Research is for Game Design!
 
Designing games with kodu_game_lab_v1
Designing games with kodu_game_lab_v1Designing games with kodu_game_lab_v1
Designing games with kodu_game_lab_v1
 
Portfolio 2011- Hugo Frénoy
Portfolio 2011- Hugo FrénoyPortfolio 2011- Hugo Frénoy
Portfolio 2011- Hugo Frénoy
 
maze runner game.pptx
maze runner game.pptxmaze runner game.pptx
maze runner game.pptx
 
Lesson 2 The Maze Runner.pptx
Lesson 2 The Maze Runner.pptxLesson 2 The Maze Runner.pptx
Lesson 2 The Maze Runner.pptx
 
A Short Workshop in Game Design
A Short Workshop in Game DesignA Short Workshop in Game Design
A Short Workshop in Game Design
 
Dodo does-math
Dodo does-mathDodo does-math
Dodo does-math
 
A Breath From Earth - Gameplay Instructions (Imagine Cup 2009)
A Breath From Earth - Gameplay Instructions (Imagine Cup 2009)A Breath From Earth - Gameplay Instructions (Imagine Cup 2009)
A Breath From Earth - Gameplay Instructions (Imagine Cup 2009)
 
Street runner final
Street runner finalStreet runner final
Street runner final
 
Forest assassin 2 d platformer game
Forest assassin 2 d platformer gameForest assassin 2 d platformer game
Forest assassin 2 d platformer game
 
Up cloth - GameDesignDoccument
Up cloth - GameDesignDoccumentUp cloth - GameDesignDoccument
Up cloth - GameDesignDoccument
 

Plus de cachs_computing (20)

It and computing assessment
It and computing assessmentIt and computing assessment
It and computing assessment
 
Forest archery game
Forest archery gameForest archery game
Forest archery game
 
Scratching the surface
Scratching the surfaceScratching the surface
Scratching the surface
 
Creating your first web page
Creating your first web pageCreating your first web page
Creating your first web page
 
Introduction
IntroductionIntroduction
Introduction
 
Desktop publishing
Desktop publishingDesktop publishing
Desktop publishing
 
Spreadsheets
SpreadsheetsSpreadsheets
Spreadsheets
 
Internet
InternetInternet
Internet
 
Getting technical introduction
Getting technical introductionGetting technical introduction
Getting technical introduction
 
It and computing assessment
It and computing assessmentIt and computing assessment
It and computing assessment
 
Introduction
IntroductionIntroduction
Introduction
 
Word processing 2
Word processing 2Word processing 2
Word processing 2
 
Word processing 1
Word processing 1Word processing 1
Word processing 1
 
Desktop publishing
Desktop publishingDesktop publishing
Desktop publishing
 
Spreadsheets
SpreadsheetsSpreadsheets
Spreadsheets
 
Introduction functional skills
Introduction functional skillsIntroduction functional skills
Introduction functional skills
 
Internet
InternetInternet
Internet
 
Search engines
Search enginesSearch engines
Search engines
 
Fetch execute cycle
Fetch execute cycleFetch execute cycle
Fetch execute cycle
 
Algorithms
AlgorithmsAlgorithms
Algorithms
 

Dernier

Haridwar Call Girls, 8699214473 Hot Girls Service Haridwar
Haridwar Call Girls, 8699214473 Hot Girls Service HaridwarHaridwar Call Girls, 8699214473 Hot Girls Service Haridwar
Haridwar Call Girls, 8699214473 Hot Girls Service Haridwar
ranekokila
 

Dernier (20)

📞 Contact Number 8617370543VIP Fatehgarh Call Girls
📞 Contact Number 8617370543VIP Fatehgarh Call Girls📞 Contact Number 8617370543VIP Fatehgarh Call Girls
📞 Contact Number 8617370543VIP Fatehgarh Call Girls
 
Book ☎️ 8617370543 Call Girls in Bharuch and escort services 24x7
Book ☎️ 8617370543 Call Girls in Bharuch and escort services 24x7Book ☎️ 8617370543 Call Girls in Bharuch and escort services 24x7
Book ☎️ 8617370543 Call Girls in Bharuch and escort services 24x7
 
Banda call girls 📞 8617370543At Low Cost Cash Payment Booking
Banda call girls 📞 8617370543At Low Cost Cash Payment BookingBanda call girls 📞 8617370543At Low Cost Cash Payment Booking
Banda call girls 📞 8617370543At Low Cost Cash Payment Booking
 
Call girls Service Khammam - 9332606886 Rs 3000 Free Pickup & Drop Services 2...
Call girls Service Khammam - 9332606886 Rs 3000 Free Pickup & Drop Services 2...Call girls Service Khammam - 9332606886 Rs 3000 Free Pickup & Drop Services 2...
Call girls Service Khammam - 9332606886 Rs 3000 Free Pickup & Drop Services 2...
 
Satara call girl 8617370543♥️ call girls in satara escort service
Satara call girl 8617370543♥️ call girls in satara escort serviceSatara call girl 8617370543♥️ call girls in satara escort service
Satara call girl 8617370543♥️ call girls in satara escort service
 
Badshah Nagar ] Call Girls Service Lucknow | Starting ₹,5K To @25k with A/C 9...
Badshah Nagar ] Call Girls Service Lucknow | Starting ₹,5K To @25k with A/C 9...Badshah Nagar ] Call Girls Service Lucknow | Starting ₹,5K To @25k with A/C 9...
Badshah Nagar ] Call Girls Service Lucknow | Starting ₹,5K To @25k with A/C 9...
 
🌹Bhubaneswar🌹Ravi Tailkes ❤CALL GIRL 9777949614 ❤CALL GIRLS IN bhubaneswar E...
🌹Bhubaneswar🌹Ravi Tailkes  ❤CALL GIRL 9777949614 ❤CALL GIRLS IN bhubaneswar E...🌹Bhubaneswar🌹Ravi Tailkes  ❤CALL GIRL 9777949614 ❤CALL GIRLS IN bhubaneswar E...
🌹Bhubaneswar🌹Ravi Tailkes ❤CALL GIRL 9777949614 ❤CALL GIRLS IN bhubaneswar E...
 
Hire 💕 8617370543 Mirzapur Call Girls Service Call Girls Agency
Hire 💕 8617370543 Mirzapur Call Girls Service Call Girls AgencyHire 💕 8617370543 Mirzapur Call Girls Service Call Girls Agency
Hire 💕 8617370543 Mirzapur Call Girls Service Call Girls Agency
 
Call Girls in Ernakulam - 9332606886 Our call girls are sure to provide you w...
Call Girls in Ernakulam - 9332606886 Our call girls are sure to provide you w...Call Girls in Ernakulam - 9332606886 Our call girls are sure to provide you w...
Call Girls in Ernakulam - 9332606886 Our call girls are sure to provide you w...
 
Call Girls Belonia Just Call 📞 8617370543 Top Class Call Girl Service Available
Call Girls Belonia Just Call 📞 8617370543 Top Class Call Girl Service AvailableCall Girls Belonia Just Call 📞 8617370543 Top Class Call Girl Service Available
Call Girls Belonia Just Call 📞 8617370543 Top Class Call Girl Service Available
 
Call Girls in Kollam - 9332606886 Our call girls are sure to provide you with...
Call Girls in Kollam - 9332606886 Our call girls are sure to provide you with...Call Girls in Kollam - 9332606886 Our call girls are sure to provide you with...
Call Girls in Kollam - 9332606886 Our call girls are sure to provide you with...
 
Dahod Call Girl 📞 8617370543 Low Price Genuine Service
Dahod Call Girl 📞 8617370543 Low Price Genuine ServiceDahod Call Girl 📞 8617370543 Low Price Genuine Service
Dahod Call Girl 📞 8617370543 Low Price Genuine Service
 
Call Girls in Perumbavoor / 9332606886 Genuine Call girls with real Photos an...
Call Girls in Perumbavoor / 9332606886 Genuine Call girls with real Photos an...Call Girls in Perumbavoor / 9332606886 Genuine Call girls with real Photos an...
Call Girls in Perumbavoor / 9332606886 Genuine Call girls with real Photos an...
 
Hire 💕 8617370543 Dhalai Call Girls Service Call Girls Agency
Hire 💕 8617370543 Dhalai Call Girls Service Call Girls AgencyHire 💕 8617370543 Dhalai Call Girls Service Call Girls Agency
Hire 💕 8617370543 Dhalai Call Girls Service Call Girls Agency
 
Ambassa Escorts | 8617370543 call girls service for all Users
Ambassa Escorts | 8617370543 call girls service for all UsersAmbassa Escorts | 8617370543 call girls service for all Users
Ambassa Escorts | 8617370543 call girls service for all Users
 
Deira call girls 0507330913 Call girls in Deira
Deira call girls 0507330913  Call girls in DeiraDeira call girls 0507330913  Call girls in Deira
Deira call girls 0507330913 Call girls in Deira
 
Bhubaneswar🌹Call Girls Chandrashekharpur ❤Komal 9777949614 💟 Full Trusted CAL...
Bhubaneswar🌹Call Girls Chandrashekharpur ❤Komal 9777949614 💟 Full Trusted CAL...Bhubaneswar🌹Call Girls Chandrashekharpur ❤Komal 9777949614 💟 Full Trusted CAL...
Bhubaneswar🌹Call Girls Chandrashekharpur ❤Komal 9777949614 💟 Full Trusted CAL...
 
Haridwar Call Girls, 8699214473 Hot Girls Service Haridwar
Haridwar Call Girls, 8699214473 Hot Girls Service HaridwarHaridwar Call Girls, 8699214473 Hot Girls Service Haridwar
Haridwar Call Girls, 8699214473 Hot Girls Service Haridwar
 
Call Girls Kozhikode - 9332606886 Our call girls are sure to provide you with...
Call Girls Kozhikode - 9332606886 Our call girls are sure to provide you with...Call Girls Kozhikode - 9332606886 Our call girls are sure to provide you with...
Call Girls Kozhikode - 9332606886 Our call girls are sure to provide you with...
 
Call girls Service Berhampur - 9332606886 Our call girls are sure to provide ...
Call girls Service Berhampur - 9332606886 Our call girls are sure to provide ...Call girls Service Berhampur - 9332606886 Our call girls are sure to provide ...
Call girls Service Berhampur - 9332606886 Our call girls are sure to provide ...
 

A mazing Game

  • 2. Starter Activity: Maze Games Check out the maze style games: http://scratch.mit.edu/tagged/shared/maze A Mazing Game
  • 3. A Mazing Game In this lesson you will use algorithms to help code a solution that uses conditional statements to make a program loop. You will create a maze style game. Lesson  Understand the use of an algorithm to develop a solution to a problem  Translate an algorithm into code  Use conditional statements Objectives
  • 4. Introduction You are going to create a simple game where the player guides an ‘explorer’ character around a maze using the arrow keys. The game will end when the explorer rescues its friend in the middle. A Mazing Game
  • 5. Watch the video Maze which is in the programming in scratch folder in Groupwork to learn how to create the game. A Mazing Game
  • 6. Task 6: Setting the Scene Set up the game by importing the stage costume (Maze) and two sprites – an explorer and a friend for the explorer to rescue. N.B The maze is already in the backgrounds folder Don’t do any more at this point. A Mazing Game
  • 7. The Importance of Design Before you make anything – a house, a car or a computer program – you should start with a design. There are two important parts to most programs – the interface (how it looks) and the code – you design these separately. A Mazing Game
  • 8. The easiest way to design the interface is by sketching it out on paper. To design the code, the easiest way is to write out a list of steps you want the code to perform in English. This is known as an algorithm. Algorithms let programmers concentrate on what the code has to do, instead of how to do it on the computer. A Mazing Game
  • 9. Designing the Solution Think about the two main things that you will need to code: 1. Moving the explorer around the maze 2. Getting the explorer to rescue its friend The table on the next slide shows an algorithm for moving the explorer around the maze and the Scratch code that does the same thing. A Mazing Game
  • 10. Algorithm for moving explorer Code when the flag is clicked repeat forever if right arrow key is pressed point right move 5 steps if left arrow key is pressed point left move 5 steps if up arrow key is pressed point up move 5 steps if down arrow key is pressed point down move 5 steps if explorer touches the same colour as the maze wall
  • 11. Task 7: Moving the Explorer Using a combination of the algorithm and the code, develop your game so that you are able to move the explorer around the maze. Use of the video is forbidden from this point onwards. A Mazing Game
  • 12. Algorithm for moving explorer Code when the flag is clicked repeat forever if right arrow key is pressed point right move 5 steps if left arrow key is pressed point left move 5 steps if up arrow key is pressed point up move 5 steps if down arrow key is pressed point down move 5 steps if explorer touches the same colour as the maze wall
  • 13. Test your game to see if it works If it doesn’t see if you can identify the problem. A Mazing Game
  • 14. Task 8: Rescuing the Explorers Friend From this algorithm, see if you can create the code for the friend sprite! A Mazing Game Algorithm for reaching centre of maze Code for friend sprite when the flag is clicked show sprite repeat forever if touching explorer sprite say “Thank you!” hide sprite stop all scripts Code this one yourself!
  • 15. Test your game to see if it works If it doesn’t see if you can identify the problem. A Mazing Game
  • 16. Plenary: Question 1 A programmer creates a maze game like the one you’ve just created. Unfortunately, the character doesn’t move as expected. What mistake has the programmer made? A Mazing Game
  • 17. Plenary: Look at the two examples of code. Do they perform the same task? A Mazing Game Question 2
  • 18. Plenary: Question 3 The code adjacent controls a sprite going round a maze. If the sprite touches the side of the maze (the colour blue), it returns to its starting position of -150, 150. Unfortunately, the sprite sometimes touches the walls of the maze and returns to the start when the player doesn’t expect. What mistake has the programmer made? A Mazing Game
  • 19. Plenary: Question 4 In this example, the sprite is supposed to return to the centre of the maze when it touches the sides (coloured blue); however, it only does this sometimes. What mistake has the programmer made? A Mazing Game
  • 20. A Mazing Game Keywords  Understand the use of an algorithm to develop a solution to a problem  Translate an algorithm into code  Use conditional statements Objectives  Loop  Sprites  Interface  Code  Indented  Conditional Statements  Collision Detection  Repetition   

Notes de l'éditeur

  1. Left and right arrow both point right (90). Left arrow should point left (-90).
  2. Yes. The forever/ if touching colour? stacks are both executed throughout the program, despite being in separate stacks in the right-hand example . This could be a good opportunity to discuss the concepts of parallelism and modularity again: Q: Why might some think the right-hand script is better than the left-hand? A: It separates movement and collisions into two stacks. These are two separate problems which should arguably be solved separately. This will make the code easier to maintain if new features are added to either aspect.
  3. The sprite moves before pointing in the correct direction. This will make it move 5 steps in the previously selected direction, causing it to touch colour blue if it happens to be close.
  4. The touching colour? block is inside the final if statement, meaning it will only ever be executed if the down arrow is pressed.