🎮Game Dev Lab — Loops make characters repeat actions! Set the repeat count, choose an action, and watch your character loop like a pro game developer!
🔄 What's a Loop?
A loop tells a program: "Do this thing, then do it again, and again..." Instead of writing the same action 10 times, you write a loop: "Repeat 10 times: jump!" Games use loops everywhere — for running animations, counting scores, and moving characters. 🔗 Remember: In Array Adventure you grabbed items from a list. Loops let you DO something to every item in that list automatically!
🎯 Today's MissionsLoop 5 times!Try every action!Complete all 4 challenges!
🎮 Loop Builder
Set how many times → Choose an action → Run the loop!
🎮
Loop counter: 0 / 5
🔁 Repeat count How many times?
5
🎬 Choose action What to repeat?
🎯 Loop Challenges
1
Run a loop that repeats 3 times — set the slider and press Run!
✅
2
Run a loop with 7 repeats and the Spin action
✅
3
Run a loop at max speed (10 repeats) with the Dance action
✅
4
Your turn! Run 3 different loops — change repeats AND action each time
✅
🌟 Mastery progress0%
🎮 Loop Master
Welcome to the Game Dev Lab! Today you'll learn about loops — one of the most powerful tools in coding. A loop repeats an action over and over. Instead of tapping "jump" 10 times, you write one loop that says: "Jump 10 times!"
🔢Set the repeat count with the slider
🎬Pick an action — Jump, Spin, Glow, Wave, or Dance
▶️Press Run Loop and watch your character repeat it!
🎯Complete all 4 challenges to become a Loop Master!
🏆 You're a Loop Master!
You built loops with different repeat counts and actions. That's exactly how game developers make characters move, jump, and dance!
📖 What you learned
A loop repeats an action a set number of times
The repeat count tells the loop when to stop — without it, the loop would run forever!
Loops let you do the SAME thing many times with ONE instruction
Games use loops for animations, scores, enemies, and more
A for loop in JavaScript looks like: for (var i=0; i<5; i++) — that means "repeat 5 times!"
👉 Tomorrow: Function Factory — bundle actions into reusable blocks! 🏭