← Back to Autumn 2025 Overview
Week 6 — Core Mechanics: Loops, Timing, Score & Coordinates
Focus Concept: Game loop & difficulty
Mini-Project: Barrel Jumper — iterative build (basic → speed-up)
This week we took last session’s start and turned it into a playable mini-game. We reviewed loops, coordinates, and movement, added a score, and linked game speed to the score so difficulty increases as you play.
Objectives
- Review how loops (especially
forever) keep a game running. - Use x/y coordinates to move sprites left/right on the LED grid.
- Create and increment a score variable at the right moment.
- Control speed using
pauseand make the game faster as the score grows. - Use simple conditions (e.g., edge checks or collisions) to react in the game.
- Understand why pauses are important for smooth motion.
Success Criteria
- I can explain how a forever loop acts like the game’s heartbeat.
- I can move a sprite using x (left/right) and y (up/down) coordinates.
- I can increment the score when an event happens (e.g., reaching the edge).
- I can adjust speed so the game gets slightly harder over time.
- I can show game over (or a final score) when a simple condition is met.
Key Vocabulary
- Loop (forever) — repeats code continuously while the program runs.
- Iteration — one full pass through a loop.
- Variable — a “box” that stores a value like
scoreorspeed. - Increment — increase a variable by a fixed amount (e.g.,
change score by 1). - Coordinate — a position on the LED grid: x = left↔right (0–4), y = up↕down (0–4).
- Condition — a true/false check that decides what happens next.
- Speed / delay — the pause time between updates; smaller pause = faster motion.
What We Built (Step-by-Step)
- Recap movement — move a sprite along the bottom row by changing x.
- Add the game loop — put movement inside a
foreverloop so it keeps updating. - Score — create
score; increment when an event happens (e.g., on reaching x = 0). - Speed-up — create
speed(e.g., 200 ms). After each score, dochange speed by -10. - Simple ending — show “game over” (or final score) when a condition is met.
Timing idea we used:
1 second = 1000 ms. Ifpauseis 100 ms, that’s ~10 updates per second;
ifpauseis 50 ms, that’s ~20 updates per second.
Try These Challenges
- Sound FX: play a short tone whenever the score increases.
- Minimum speed: don’t let the game get too fast (e.g., stop at 60 ms).
- Edge rule: only score when the sprite reaches an edge (not every step).
- Display score: show the final score at the end of the game.
Resources
- MakeCode Editor: makecode.microbit.org
- MakeCode Game reference (sprites, collisions): Reference
- MakeCode barrel Jumper game code: Makecode code
- What are coordinates - BBC Bitesize Link
- STE(A)M carees in gaming industry: Video
- Game development career pathways: Video
- Some simple vector maths for game making: Link
Equipment
- BBC micro:bits + USB cables (or simulator)
- Chromebooks with internet access
- Optional: speakers/headphones for sound effects
Safety & Setup Notes
- Keep USB cables tidy and avoid pulling on connected micro:bits.
- Test small changes often (download to device or use the simulator).
- Only one MakeCode project tab at a time to prevent confusion.