Most HTML5 game books were written between 2011 and 2018, when the canvas element and JavaScript game engines were new. The best of them teach things that haven't changed: the game loop, drawing with the Canvas API, sprites, collision detection, physics and game design. The weakest teach libraries that no longer exist. This guide sorts the 25 titles people search for most into books that still hold up, books for Phaser, and books that are mainly of historical interest, with the publisher, year and an honest note on each.
We make HTML5 games for a living (50 so far, on Phaser 4 and Three.js), and we judged each book by its published contents and by how much of its technology still exists in October 2026, when we checked every publisher listing. We don't host or link PDFs of these books. Each entry links to the publisher, the author or a legitimate retailer, and the section on PDFs and source code lists the legal ways to read them and get their code. If you'd rather learn from video, see our guide to HTML5 game development courses.
The best HTML5 game development books at a glance
| Book | Author | Publisher, year | Best for | Still useful in 2026? |
|---|---|---|---|---|
| Foundation Game Design with HTML5 and JavaScript | Rex van der Spuy | Apress, 2012 | Complete beginners | Yes, for fundamentals |
| Advanced Game Design with HTML5 and JavaScript | Rex van der Spuy | Apress, 2015 | Building your own engine | Yes |
| Build an HTML5 Game | Karl Bunyan | No Starch Press, 2015 | A first full project | Yes, if you skip the jQuery parts |
| Core HTML5 Canvas | David Geary | Prentice Hall, 2012 | Canvas 2D in depth | Yes, as a reference |
| Phaser by Example | Pello Xabier Altadill, Richard Davey | Phaser Studio, 2024 | Phaser 3 projects | Yes; most of it applies to Phaser 4 |
| Physics for JavaScript Games, Animation, and Simulations | Dev Ramtal, Adrian Dobre | Apress, 2014 | Game physics | Yes |
| Building a 2D Game Physics Engine | Tanaya, Chen, Pavleas, Sung | Apress, 2017 | Writing a physics engine | Yes |
| Pro HTML5 Games (2nd edition) | Aditya Ravi Shankar | Apress, 2017 | Bigger projects: physics game and RTS | Mostly |
| The Essential Guide to HTML5 (2nd edition) | Jeanine Meyer | Apress, 2018 | Learning to program through games | Yes, for beginners |
Best books for HTML5 game fundamentals
Foundation Game Design with HTML5 and JavaScript (2012)
Rex van der Spuy's beginner book (Apress, 2012) assumes no programming experience. Across 12 chapters you build logic and adventure games, control a character with keyboard, mouse or touch, and add collision detection, then move on to maze, platform and fast action games. Chapter 5's project is the Island Adventure map game, and chapter 9 builds Alien Armada. The JavaScript style is from 2012, but the ideas are the ones every game still needs. Apress publishes the book's source files on GitHub, and the Apress/Springer page sells the ebook.
Advanced Game Design with HTML5 and JavaScript (2015)
The follow-up (Apress, 2015) is the best "build it yourself" book on this list. The chapters run from the Canvas drawing API, game assets, sprites and a scene graph through movement, interactivity, collision detection, "juice", the Web Audio API and tweening, to building your own game engine, with an appendix on vectors. Everything is plain JavaScript without libraries, which is why it has aged well: you learn what Phaser does for you. Readers searching for its contents, a review or a GitHub repository should start at the Apress page; we couldn't find an official GitHub repository for this title.
Build an HTML5 Game by Karl Bunyan (2015)
Build an HTML5 Game: A Developer's Guide with CSS and JavaScript (No Starch Press, March 2015, 224 pages) builds one game, a bubble shooter for desktop and mobile browsers, from start to finish. It covers sprite animation, collision detection with hitboxes, level and input logic, CSS transitions and transforms, and pixel-level drawing on canvas. It leans on jQuery, which modern code doesn't need, but the structure of a complete game is clear. No Starch's page sells the print book and ebook (PDF, Mobi and ePub), offers a free sample chapter, and links the source code and exercise solutions. Amazon and other retailers stock the print edition.
Core HTML5 Canvas: Graphics, Animation, and Game Development (2012)
David Geary's book (Prentice Hall, 2012, over 700 pages) is the deepest book-length treatment of the Canvas 2D API: drawing, images, text, animation, sprites, physics and collision detection, ending with a game engine and a pinball game. It's for developers with intermediate JavaScript. The core API it teaches hasn't changed much, so it remains a useful reference. InformIT sells the ebook; the book's companion site, which hosted its code and demos, didn't load when we checked in October 2026.
The Essential Guide to HTML5: Using Games to Learn HTML5 and JavaScript (2018)
Jeanine Meyer's book (Apress; second edition 2018, after an earlier first edition) teaches programming itself through small games: dice, a bouncing ball, cannonball and slingshot, a quiz, mazes, hangman and blackjack. It also covers saving high scores with localStorage. Choose it if you're new to programming and want short, finished projects rather than one big game.
Foundation HTML5 Canvas: For Games and Entertainment (2011)
Rob Hawkes's book (friends of ED, an Apress imprint, 2011) is a gentle introduction aimed at web designers, ending with two games: Space Bowling and Asteroid Avoidance. It's very basic by today's standards, and the books above cover the same ground in more depth. It's available in O'Reilly's online library.
Best books on physics for JavaScript games
Physics for JavaScript Games, Animation, and Simulations (2014)
Dev Ramtal and Adrian Dobre's book (Apress, June 2014, about 500 pages) adds real physics to canvas games: gravity, friction, buoyancy, collisions and particle systems, with notes on trading accuracy for simplicity. It assumes basic JavaScript and no physics. Physics doesn't age, so this is still the book to get if your game needs believable motion. See the Apress page.
Building a 2D Game Physics Engine: Using HTML5 and JavaScript (2017)
By Michael Tanaya, Huaming Chen, Jebediah Pavleas and Kelvin Sung (Apress, 2017), this short book builds a rigid-body physics engine step by step: a small maths library, rigid shapes, collision detection and collision response. Read it to understand what Matter.js, Box2D or Rapier do inside, not to replace them in a shipping game. See the Springer page, and our guide to HTML5 game physics for engines worth using.
Best Phaser books
Phaser 4 shipped in April 2026, and most of its public API matches Phaser 3, so Phaser 3 books still teach the right structure; check rendering, effects and masks against the current docs. Our Phaser tutorial uses Phaser 4.2.1 and lists what changed. Books written for Phaser 2 (before 2018) use a different API and are best treated as design reading.
Phaser by Example (2024)
Written by Pello Xabier Altadill and Richard Davey, Phaser's creator, this is the official Phaser 3 book: over 500 pages of projects, from an infinite runner through a shoot-'em-up, platformer, puzzle, roguelike, story game, 3D game and multiplayer shooter. Phaser Studio gives it away free with its source code to anyone who registers a Phaser account. If you're looking for a legal Phaser PDF, this is it.
An Introduction to HTML5 Game Development with Phaser.js (2016)
Travis Faas's book (A K Peters/CRC Press, 2016; ebook 2017) builds a small game in each of its chapters. Phaser's site described it as unofficial when it launched in October 2016, and it targets Phaser 2, so its code won't run on Phaser 3 or 4 without changes. See Routledge's page.
HTML5 Cross Platform Game Development Using Phaser 3 (2018)
Emanuele Feronato, one of the most prolific Phaser tutorial writers, self-published this book in June 2018. It builds a 2048-style game while covering scaling for different devices, asset loading, sprite sheets, tweens, input, sound and bitmap fonts, and a later free update showed how to wrap the game as an Android app. His earlier book, Create HTML5 Vertical Endless Runner Cross Platform Games (2015), got a Phaser 3 version of its Tunnel Trouble game in 2021. Both are sold through the author's site.
Create and Publish HTML5 Games in 24 Hours (2018)
William Clarkson's Kindle book (September 2018, about 300 pages) is a step-by-step guide to making games with Phaser 3, from drawing on the canvas to a reusable game system for desktop and mobile.
Developing an HTML5 Brick-Breaker Game with Phaser (2015)
Jorge Palacios's short book on Leanpub builds one brick-breaker game in three chapters: sprites, sound, web fonts, touch and keyboard input, Arcade physics, particles, game states, a loading screen and mobile tweaks. It uses Phaser 2, and its GitHub repository holds the starter projects and assets.
Older HTML5 game books: are they worth it in 2026?
These books shaped HTML5 game development, but each depends on something that has changed: a retired engine, an old browser API or a distribution channel that no longer exists. Read them for ideas, not code.
Pro HTML5 Games (2012, 2nd edition 2017)
Aditya Ravi Shankar's book builds two complete games: Froot Wars, a Box2D physics puzzle game, and Last Colony, a real-time strategy game with pathfinding, AI and WebSocket multiplayer. The second edition (Apress, October 2017) adds mobile development and a toolkit chapter. It's the most ambitious project book here and still worth reading for the RTS chapters; look for its source code link on the Apress page.
HTML5 Games: Creating Fun with HTML5, CSS3 and WebGL (2011, 2nd edition 2014)
Jacob Seidelin's book (Wiley) builds a game from scratch using canvas, HTML5 audio, WebGL and WebSockets, including multiplayer and 3D. Browser audio and graphics have moved on since 2014, so expect to adapt its code. It's in O'Reilly's online library.
Learning HTML5 Game Programming (2011)
James L. Williams's book (Addison-Wesley, 2011) surveys Canvas, SVG and WebGL. The author keeps the code samples on GitHub, and InformIT sells the ebook. Many of the libraries it surveys are no longer maintained.
HTML5 Game Development For Dummies (2013)
Andy Harris's book (Wiley, April 2013, 384 pages) is a friendly beginner's guide with sports, adventure, pong and board game projects. It's dated, but readable for someone new to programming. See O'Reilly's listing.
HTML5 Game Development by Example (2011, 2nd edition 2015)
Makzan's Packt book (first edition titled HTML5 Games Development by Example: Beginner's Guide) builds six games, including DOM ping pong, a CSS3 card-matching game, a Box2D physics game and a WebSocket draw-and-guess multiplayer game. The 2015 second edition adds mobile chapters on home-screen web apps and wrapping a game in a WebView, which is the closest thing to the "HTML5 mobile game development by example" people search for. Packt lists code downloads on each book's page.
Learn HTML5 by Creating Fun Games (2013)
Rodrigo Silveira's Packt book (June 2013) builds a different game in each chapter, mostly with canvas, and keeps theory to short tip boxes. Its HTML5 coverage includes APIs that were new in 2013, so expect some of it to be out of date.
HTML5 Games Most Wanted (2012)
A friends of ED anthology in which the makers of browser games explain how they built them, including Marble Run, CycleBlob (a WebGL light-cycle game) and Z-Type, plus WebSocket multiplayer. Contributors include Egor Kuryanovich, Shy Shalom, Russell Goldenberg, Seb Lee-Delisle and Rob Hawkes. It's a good read for inspiration. See the Apress page.
Making Isometric Social Real-Time Games with HTML5, CSS3, and JavaScript (2011)
Mario Andrés Pagella's short O'Reilly book covers isometric grids, sprite animation, Web Workers for pathfinding, a PHP and MySQL back end and Facebook integration, ending with a resort-building game. The Facebook-game model it targets has faded, but the isometric chapters are still useful; our guide to isometric HTML5 games covers the same maths with current tools.
Professional HTML5 Mobile Game Development (2012)
Pascal Rettig's Wrox book builds a reusable engine, which became the open-source Quintus engine, though the repository has since diverged from the book. The chapter code downloads come from Wrox. The engine-building chapters are good; the 2012 mobile advice is not.
HTML5 Game Engines: App Development and Distribution (2014)
Dan Nagle's book (A K Peters/CRC Press, April 2014, 216 pages) builds Pong without dependencies, then four games with Crafty, EaselJS, Impact and Turbulenz, and covers distribution through the Chrome Web Store, Apple's App Store, Google Play and Facebook. Several of those engines and channels are no longer active, so it's mainly of historical interest. See CRC Press.
Building HTML5 Games with ImpactJS (2012)
Jesse Freeman's O'Reilly book (February 2012) teaches the Impact engine, which was a paid product then and is now open source under the MIT licence. Read it only if you maintain an Impact game.
Courses and tutorials that look like books
Some titles people search for as books are actually courses or articles:
- HTML5 Canvas: Create 5 Games, 5 Projects and Learn JavaScript is a Packt video course by Laurence Svekis (2020) that builds Pong, a catcher game, a popper, a battle game and Breakout on canvas.
- HTML5 Mobile Game Development with Phaser is an older Zenva course built around an infinite runner, not a book.
- Build a Tile-Based HTML5 Game is a Creative Bloq tutorial by Dan Neame covering maps, agents and canvas rendering.
- Let's make a 3D game with HTML5 (often searched with "mcteapot"): we couldn't find a published book by that name. For 3D in the browser today, read our guide to 3D HTML5 games.
Looking for a PDF, ebook or free download?
Searches for these books often end in "pdf", "epub", "free download" or even "torrent". We don't host book PDFs and we don't link to unofficial copies. Pirated files are often outdated scans, sometimes carry malware, and take money from the authors who wrote the books. The legal routes are cheaper than they look:
- Buy the ebook from the publisher. No Starch sells PDF, Mobi and ePub editions; Apress sells ebooks through Springer; InformIT sells Addison-Wesley and Prentice Hall titles.
- Use a library. Many public and university libraries give members free access to O'Reilly's online library, which carries most of the Apress, Packt, Wiley, O'Reilly and Addison-Wesley books above.
- Get the free ones. Phaser by Example is free from Phaser Studio, and MDN's game development tutorials cover the same basics as the beginner books at no cost.
- Read our free code. Our HTML game code pages are complete, MIT-licensed games with line-by-line explanations.
Where to get the source code for these books
| Book | Official code |
|---|---|
| Foundation Game Design with HTML5 and JavaScript | Apress repository on GitHub |
| Build an HTML5 Game | Download link on No Starch's page |
| Learning HTML5 Game Programming | Author's GitHub repository |
| Phaser by Example | With the free book, after registering on phaser.io |
| Developing an HTML5 Brick-Breaker Game with Phaser | GitHub repository linked from Leanpub |
| Professional HTML5 Mobile Game Development | Wrox chapter downloads |
| Advanced Game Design, Pro HTML5 Games, Physics for JavaScript Games | The book's Apress page |
| HTML5 Game Development by Example | The book's Packt page |
Where to get the images and code for Foundation Game Design with HTML5
The pictures, maps and other images for Foundation Game Design with HTML5 and JavaScript, including the Island Adventure game in chapter 5, are in the book's official source files. Open the Apress repository, go to Code - Published/chapter05/islandAdventure, and you'll find images, fonts and src folders. Download the repository as a ZIP from GitHub's Code button. The README says the release matches the code printed in the book, without later corrections.
How to learn from an older HTML5 game book in 2026
An old book is still a good teacher if you adapt as you go:
- Run examples through a local web server (
npx serveorpython -m http.server), not by double-clicking the HTML file. - Use
requestAnimationFramefor the loop if the book usessetInterval, and base movement on elapsed time. - Start audio after the first tap or click. Browsers block autoplay, which breaks many pre-2018 examples.
- Use pointer events instead of separate mouse and touch handlers.
- Swap retired libraries for current ones: plain DOM code for jQuery, Phaser 4 for Phaser 2 or Impact, Matter.js or Rapier for old Box2D ports.
Our guides to making an HTML5 game and HTML5 canvas games cover the modern versions of these basics, and our guides hub has the full learning path. When you want to see how a commercial game is put together, every one of our 50 HTML5 games ships as a TypeScript project with its tests and data files, and you can play each one in the browser first.
Frequently asked questions
What is the best book for HTML5 game development?
For complete beginners, Foundation Game Design with HTML5 and JavaScript. For developers who want to understand engines, Advanced Game Design with HTML5 and JavaScript. For Phaser, Phaser by Example, which is free. All three teach ideas that still apply in 2026.
Are there free HTML5 game development books?
Yes. Phaser by Example is free from Phaser Studio with a Phaser account, and the source code of several books above is free on GitHub. Free legal copies of the commercial books are usually available through library access to O'Reilly's online library.
Is there a book for Phaser 4?
Phaser 4 only shipped in April 2026, so most Phaser books cover Phaser 3, and a few new titles claim to cover both. Phaser 3 books remain useful because most of the API carried over; use Phaser's own documentation and examples for the parts that changed.
Can I download these books as PDFs from your site?
No. We don't host or link third-party book PDFs. Use the publisher links above, your library, or the free resources we list.
We make and sell HTML5 game source code; links to our games are marked as ours.