HTML5 Foundations
Document structure, elements, attributes, images, links, semantic tags and a first taste of CSS.
Learn HTML5 game development by reading, running, and rewriting real games. Every lab gives you the objectives, a guided file-by-file activity, a live preview of each game, and checkpoints you tick off as you go.
This lab teaches HTML5 and JavaScript by building complete, playable games — the same teaching approach used in The Essential Guide to HTML5: Using Games to Learn HTML5 and JavaScript (3rd edition) by Jeanine Meyer. Rather than learning the language in isolation, you start with a small working game and grow it step by step, one idea at a time.
Each of the six weekly labs is adapted from one of the book's games and follows the same objectives → guided build → complete-the-code flow:
Everything is written in plain HTML5, the Canvas 2D API and JavaScript — no frameworks and no libraries — so what you write is standard web technology you can reuse anywhere.
The games you build include the Craps dice game, the bouncing ball, the cannonball and slingshot, the memory (matching) game, and an ordering quiz with audio and video rewards. Examples and game ideas are adapted from The Essential Guide to HTML5 (3rd ed.) by Jeanine Meyer.
Document structure, elements, attributes, images, links, semantic tags and a first taste of CSS.
Draw with <canvas>, generate random numbers, handle clicks and build the Craps dice game.
Animate with timers, bounce a ball off walls, wire up form inputs and mix in images, gradients and video.
Build reusable game objects, follow mouse input and launch a projectile with gravity in the slingshot game.
Arrays, images, shuffling, click hit-testing and match logic — plus drawing polygons on the canvas.
Control media from JavaScript and build an ordering quiz that rewards correct answers with sound and video.
Week1) on your PC and copy the example
files you need from this site into it.filename_yourname.html in the same week folder.No server needed: just open index.html in your browser. Progress and quiz scores
are saved in this browser only. Lecturers can add ?answers=1 to a lab URL to reveal all hints
and solutions.
New to the tools? Read the Setup guide for VS Code and Sublime Text instructions.