Level 13 – Lesson 01 [Using Loops]

Introduction
Almost every programming language has the capability to loop code. The technical term is ‘iteration’ or ‘iterate’ which means to repeat. In this lesson we will take a look at some different types of loops you can code in GameMaker.

Part A – Basic Loop Structures
Watch the video: 13-01-A
Done File:  L13-01-A-Done.gmk


Challenge 1 – Loop Reading/Writing

Worksheet: LoopWorksheet01.pdf
Solutions: LoopWorksheet01_Answers.pdf

Practice some code reading and writing with loops and complete the worksheet. Answers are provided. It should be noted that there are several answers for each code segment. For example, k<5 as a condition is the same as k<=4 if you are dealing with integer values.

Part B – Using the Loop Counter
Watch the video: 13-01-B
Done File:  L13-01-B-Done.gmk

Challenge 2 – More Loop Reading/Writing

Worksheet: LoopWorksheet02.pdf
Solutions: LoopWorksheet02_Answers.pdf

A little more loop reading and writing, but this time they get a little trickier.

Part C – Loop Warning!
Watch the Video: 13-01-C
A quick video about avoiding the endless loop!
It happens to all of us.