SlideShare a Scribd company logo
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




More Related Content

What's hot

Educational game pitch
Educational game pitchEducational game pitch
Educational game pitchBrandon Wilton
 
Snake game implementation in c
Snake game implementation in cSnake game implementation in c
Snake game implementation in c
Upendra Sengar
 
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 Giangogdc
 
Reserach on porgrammign 8 bit
Reserach on porgrammign 8 bitReserach on porgrammign 8 bit
Reserach on porgrammign 8 bit
quantumdominic
 
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 prototypeGameLandVN
 
Cristian galliano presentation
Cristian galliano  presentationCristian galliano  presentation
Cristian galliano presentation
crisgalliano
 
5. pre production(2)
5. pre production(2)5. pre production(2)
5. pre production(2)
Will Stewart
 
5.pre production
5.pre production5.pre production
5.pre production
Adele Rolf
 
Computers of the Future
Computers of the FutureComputers of the Future
Computers of the Future
University High School
 

What's hot (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
 

Viewers also liked

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...
eMadrid network
 
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 ...Bing Kimpo Media | Communications
 
Scratch and pair programming
Scratch and pair programmingScratch and pair programming
Scratch and pair programmingjtelss10
 
Scratch Lesson 3
Scratch Lesson 3Scratch Lesson 3
Scratch Lesson 3
Vadim Axelrod
 
Scratch Lesson 1
Scratch Lesson 1Scratch Lesson 1
Scratch Lesson 1
Vadim Axelrod
 
Scratch Lesson 2
Scratch Lesson 2Scratch Lesson 2
Scratch Lesson 2
Vadim Axelrod
 

Viewers also liked (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
 

Similar to A mazing Game

Scratch parrot shoot game
Scratch   parrot shoot gameScratch   parrot shoot game
Scratch parrot shoot game
mrsharma2015
 
Scratch Parrot Game
Scratch Parrot GameScratch Parrot Game
Scratch Parrot Game
jenloudun
 
intern.pdf
intern.pdfintern.pdf
intern.pdf
cprabhash
 
4.3 collision detection
4.3   collision detection4.3   collision detection
4.3 collision detectionallenbailey
 
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...
Codemotion
 
Work Flow for 2D Game
Work Flow for 2D GameWork Flow for 2D Game
Work Flow for 2D Game
bowes96123
 
An introduction to coding
An introduction to codingAn introduction to coding
An introduction to coding
iain bruce
 
Lesson-1-Hack-Attack.pptx
Lesson-1-Hack-Attack.pptxLesson-1-Hack-Attack.pptx
Lesson-1-Hack-Attack.pptx
JohnMichaelPadernill
 
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!
Marina Kobayashi
 
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
KerryJTurner
 
Portfolio 2011- Hugo Frénoy
Portfolio 2011- Hugo FrénoyPortfolio 2011- Hugo Frénoy
Portfolio 2011- Hugo Frénoy
Hugo Frénoy
 
Lesson 2 The Maze Runner.pptx
Lesson 2 The Maze Runner.pptxLesson 2 The Maze Runner.pptx
Lesson 2 The Maze Runner.pptx
JohnMichaelPadernill
 
A Short Workshop in Game Design
A Short Workshop in Game DesignA Short Workshop in Game Design
A Short Workshop in Game Design
Pietro Polsinelli
 
Dodo does-math
Dodo does-mathDodo does-math
Dodo does-math
Mohammed Kemal
 
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
 
Street runner final
Street runner finalStreet runner final
Street runner final
Kumar Narayan
 
Forest assassin 2 d platformer game
Forest assassin 2 d platformer gameForest assassin 2 d platformer game
Forest assassin 2 d platformer game
Anshuman Pattnaik
 
Up cloth - GameDesignDoccument
Up cloth - GameDesignDoccumentUp cloth - GameDesignDoccument
Up cloth - GameDesignDoccument
Eléonore Arbaux
 

Similar to 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
 

More from 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
 

Recently uploaded

Lite version of elevator game simplified.pptx
Lite version of elevator game simplified.pptxLite version of elevator game simplified.pptx
Lite version of elevator game simplified.pptx
einarsvan32
 
Scandal! Teasers June 2024 on etv Forum.co.za
Scandal! Teasers June 2024 on etv Forum.co.zaScandal! Teasers June 2024 on etv Forum.co.za
Scandal! Teasers June 2024 on etv Forum.co.za
Isaac More
 
Skeem Saam in June 2024 available on Forum
Skeem Saam in June 2024 available on ForumSkeem Saam in June 2024 available on Forum
Skeem Saam in June 2024 available on Forum
Isaac More
 
Dehradun Girls 9719300533 Heat-lava { Dehradun } Whiz ℂall Serviℂe By Our
Dehradun Girls 9719300533 Heat-lava { Dehradun } Whiz ℂall Serviℂe By OurDehradun Girls 9719300533 Heat-lava { Dehradun } Whiz ℂall Serviℂe By Our
Dehradun Girls 9719300533 Heat-lava { Dehradun } Whiz ℂall Serviℂe By Our
rajeshkumar821445
 
NO1 Pandit Black Magic Specialist Expert In Bahawalpur, Sargodha, Sialkot, Sh...
NO1 Pandit Black Magic Specialist Expert In Bahawalpur, Sargodha, Sialkot, Sh...NO1 Pandit Black Magic Specialist Expert In Bahawalpur, Sargodha, Sialkot, Sh...
NO1 Pandit Black Magic Specialist Expert In Bahawalpur, Sargodha, Sialkot, Sh...
Amil baba
 
Panchayat Season 3 - Official Trailer.pdf
Panchayat Season 3 - Official Trailer.pdfPanchayat Season 3 - Official Trailer.pdf
Panchayat Season 3 - Official Trailer.pdf
Suleman Rana
 
Meet Crazyjamjam - A TikTok Sensation | Blog Eternal
Meet Crazyjamjam - A TikTok Sensation | Blog EternalMeet Crazyjamjam - A TikTok Sensation | Blog Eternal
Meet Crazyjamjam - A TikTok Sensation | Blog Eternal
Blog Eternal
 
Reimagining Classics - What Makes a Remake a Success
Reimagining Classics - What Makes a Remake a SuccessReimagining Classics - What Makes a Remake a Success
Reimagining Classics - What Makes a Remake a Success
Mark Murphy Director
 
Barbie Presentation Template.pptx aaaaaa
Barbie Presentation Template.pptx aaaaaaBarbie Presentation Template.pptx aaaaaa
Barbie Presentation Template.pptx aaaaaa
Christiandelacruz884686
 
The Evolution of Animation in Film - Mark Murphy Director
The Evolution of Animation in Film - Mark Murphy DirectorThe Evolution of Animation in Film - Mark Murphy Director
The Evolution of Animation in Film - Mark Murphy Director
Mark Murphy Director
 

Recently uploaded (10)

Lite version of elevator game simplified.pptx
Lite version of elevator game simplified.pptxLite version of elevator game simplified.pptx
Lite version of elevator game simplified.pptx
 
Scandal! Teasers June 2024 on etv Forum.co.za
Scandal! Teasers June 2024 on etv Forum.co.zaScandal! Teasers June 2024 on etv Forum.co.za
Scandal! Teasers June 2024 on etv Forum.co.za
 
Skeem Saam in June 2024 available on Forum
Skeem Saam in June 2024 available on ForumSkeem Saam in June 2024 available on Forum
Skeem Saam in June 2024 available on Forum
 
Dehradun Girls 9719300533 Heat-lava { Dehradun } Whiz ℂall Serviℂe By Our
Dehradun Girls 9719300533 Heat-lava { Dehradun } Whiz ℂall Serviℂe By OurDehradun Girls 9719300533 Heat-lava { Dehradun } Whiz ℂall Serviℂe By Our
Dehradun Girls 9719300533 Heat-lava { Dehradun } Whiz ℂall Serviℂe By Our
 
NO1 Pandit Black Magic Specialist Expert In Bahawalpur, Sargodha, Sialkot, Sh...
NO1 Pandit Black Magic Specialist Expert In Bahawalpur, Sargodha, Sialkot, Sh...NO1 Pandit Black Magic Specialist Expert In Bahawalpur, Sargodha, Sialkot, Sh...
NO1 Pandit Black Magic Specialist Expert In Bahawalpur, Sargodha, Sialkot, Sh...
 
Panchayat Season 3 - Official Trailer.pdf
Panchayat Season 3 - Official Trailer.pdfPanchayat Season 3 - Official Trailer.pdf
Panchayat Season 3 - Official Trailer.pdf
 
Meet Crazyjamjam - A TikTok Sensation | Blog Eternal
Meet Crazyjamjam - A TikTok Sensation | Blog EternalMeet Crazyjamjam - A TikTok Sensation | Blog Eternal
Meet Crazyjamjam - A TikTok Sensation | Blog Eternal
 
Reimagining Classics - What Makes a Remake a Success
Reimagining Classics - What Makes a Remake a SuccessReimagining Classics - What Makes a Remake a Success
Reimagining Classics - What Makes a Remake a Success
 
Barbie Presentation Template.pptx aaaaaa
Barbie Presentation Template.pptx aaaaaaBarbie Presentation Template.pptx aaaaaa
Barbie Presentation Template.pptx aaaaaa
 
The Evolution of Animation in Film - Mark Murphy Director
The Evolution of Animation in Film - Mark Murphy DirectorThe Evolution of Animation in Film - Mark Murphy Director
The Evolution of Animation in Film - Mark Murphy Director
 

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   

Editor's Notes

  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.