Coding with browser games
A free, editable, classroom-ready lesson plan for introducing programming concepts through browser games. Suitable for grades 3-12. Two 45-minute sessions, no installs, no accounts. Licensed CC-BY-4.0 — adapt and share freely.
Length
Two 45-minute sessions
Materials
One web-enabled device per student
Network
Any browser; no installs or admin access
Prep
~15 min (test the games on a classroom device)
Outcomes
Students recognize sequencing, conditionals, loops, and procedures in game logic
License
CC-BY-4.0 — attribute and adapt freely
Why browser games for coding instruction?
Three reasons. First, the feedback loop is immediate: students try a strategy, see it succeed or fail, and adjust — that is the fundamental rhythm of debugging. Second, the games can be played without prior coding knowledge, so students who haven't yet built a mental model of "code" can still engage with what programs do. Third, every game on the recommended list embeds in your LMS (Canvas, Google Classroom, etc.), runs on the school network, and never asks for an install.
Session 1 — Sequencing and conditionals (45 min)
Objective: students identify the order of steps required to solve a puzzle (sequencing) and the rules that change behavior under different conditions (conditionals), naming both in plain language by the end of the session. Pick one primary game; have a backup ready.
- Fifteen Puzzle — Pure sequencing — solve by ordering moves.
- Slide Puzzle Grid — Easier visual variant of Fifteen.
- Tiny Tactics — Conditional moves (if X, then Y).
Lesson flow
- 0-5: Warm-up — ask what "sequence" means outside math class (recipe steps, getting dressed).
- 5-10: Introduce the game; let students explore for 5 minutes with no guidance.
- 10-25: Independent play. Walk around asking "what's the next move?" — listen for students planning ahead.
- 25-35: Discussion — have students describe a 3-step sequence they used. Introduce the word "sequence."
- 35-40: Add a rule ("you can't undo a move") and replay. The change in strategy is the conditional.
- 40-45: Close — "if the rule is X, then we have to Y." Name the pattern: a conditional.
Informal assessment: can the student describe a 3-step plan in order? When the rule changes, do they modify their strategy? Plan-modification = understanding the conditional. Differentiation: fast finishers teach a peer; strugglers use the easier Slide Puzzle Grid or pair-program; the puzzles are visual, so language burden is low for English-language learners.
Session 2 — Loops and abstractions (45 min)
Objective: students identify repeating patterns in gameplay (loops) and the benefit of naming a multi-step procedure for re-use (abstractions / procedures), naming both in plain language by the end.
- Aero Dash — Endless-runner loop; pattern matching.
- Tiny Platformer — Sequence + reuse (same jump pattern, many levels).
- Radius Raid — Repeating wave pattern; recognize cycles.
Lesson flow
- 0-5: Warm-up — brainstorm things in daily life that repeat (brushing teeth, a song's chorus).
- 5-15: Introduce the game; students play 8-10 minutes, looking for a pattern.
- 15-25: Discussion — what pattern did you find? Name it: "loop."
- 25-35: Procedures — students describe a 3-step move that works against many obstacles ("jump, slide, jump"). That named move is a procedure.
- 35-40: Students write their own named procedure (1 sentence); optionally swap with a peer and try each other's.
- 40-45: Close — connect the named procedure to functions in real programming.
Assessment: can the student name the pattern in plain English, and describe a reusable multi-step procedure? Differentiation: stretch fast finishers with nested loops; for strugglers, lean on the daily-routine example — the point is naming a repeating sequence, not finding the perfect game pattern.
After these sessions
If students are ready for typed syntax, move to Scratch (same model via drag-and-drop blocks), Code.org's Hour of Code, or for Grade 8+, a real JavaScript playground like Repl.it. Browser games introduce concepts; they don't deepen them — don't have students replay the same game expecting more learning, and don't grade on game performance (it's mostly orthogonal to coding ability). Grade on discussion contributions and the named procedure they write.
Network & IT considerations
If your content filter blocks the game URLs, the embedded version (pixelgameshub.com/games/<slug>/embed) often passes filters that block the canonical page — test in advance. The iframe sandbox uses allow-scripts only: it cannot write cookies, pop up windows, or access parent-page data — forward that to IT if they push back. For a whitelist request, point them at the embed documentation.
Embed a game in your classroom page
Paste this into Google Classroom (HTML view), Canvas, or any LMS that accepts iframes. Keep the attribution line.
<iframe src="https://pixelgameshub.com/games/<slug>/embed"
width="800" height="600" frameborder="0"
sandbox="allow-scripts" loading="lazy"></iframe>
<p>Play <a href="https://pixelgameshub.com/games/<slug>">[game name]</a>
free on <a href="https://pixelgameshub.com">PixelGamesHub</a>.</p>Companion guides
Curated, classroom-safe game lists that pair with this plan:
Used this in your classroom? Email partnerships@pixelgameshub.com — we revise from real feedback. License: CC-BY-4.0.