Lesson #11
Loops
Loops are an efficient way of coding repetition and shortening your code whilst remaining effective. In today's lesson we will look at the advantages of Loops and how it will save you time and energy when coding your games. Happy Coding!
Learning Intention
Enhance my programming skills by using Loops.
Success Criteria
I can use Loops to ensure my code is efficient.
I can use Loops to make debugging easier.
I can use Loops to allow my Sprite to multitask.
Introduction
Discuss and make a list of day to day jobs that you do that involve repetition.
Watch the short video to the right and highlight the advantages of Loops, why would you choose to use Loops when making your games?
Questions
What are some of the advantages to using Loops? Saves time programming, reduces the risk of mistakes, simplifies code.
Can you think of a scenario in your personal game where Loops may come in useful?
Key Learning in Main Task Video
Forever Command
Repeat Command.
Repeat until Command.
Plenary
Encourage pupils to share examples with each other and with the class on how they have used loops to improve their game.
Discuss some of the ways in which pupils thought loops might be useful in their game.
Questions
How has loops improved your game? Saves time programming, reduces the risk of mistakes, simplifies code.
How much time do you think using Loops has saved you writing code? Depends on the use of Loops, allow pupils to come up with their own reasoning.
Do you think it will be easier to fix problems when using Loops rather than long lines of code? Why? Yes, as mistakes will be easier to spot and solutions will be easier to explore.
Extending the Learning
Suggested Links to IDL Planner
Use a dictionary to help you understand new gaming words and create a personal dictionary using the definitions. Here are some to get started with - AI, AR, Gamification, Bug, Beta, Code, Console, Content, Demo, Feature, Mechanics, Mobile gaming, PC, Pixel, Playtesting, Quality assurance, Scripting, Sprite, e-sports, Sandbox. (LIT 2-15a)
Use the Internet to find images of handheld gaming devices from the 1980s and 1990s and comment on their design. (TCH 2-01a, TCH 2-03a)
Create a Slideshow/Vlog or animation to showcase what you have learned about Gaming throughout the Game Jam so far. (EXA 2-05a, EXA 2-06a, TCH 2-01a, TCH 2-03a)
Additional Resources - Loops
Reinforce the understand and application of Loops in Scratch with this supplementary lesson from Barefoot Computing.