Leanpub Header

Skip to main content

Canvas Academy

Build real 2D games with the HTML5 Canvas — no engine, no framework, no build step

Canvas Academy
This book is 100% completeLast updated on 2026-08-17

You don't need Unity to make a game. A text editor, a browser, and 24 chapters: build a complete Breakout from scratch, then your own games — with the HTML5 Canvas and nothing else.

Minimum price

$9.99

$14.99

You pay

Author earns

$

Also available for 1 book credit with a Reader Membership

PDF
EPUB
WEB
APP
About

About

About the Book

You don't need Unity to make a game. You need a <canvas> tag, one honest game loop, and someone to show you the twenty ideas that every 2D game ever shipped is built from.

Canvas Academy is a typing book, not a reading book. Every chapter gives you a short, complete listing to run in the workbench file you build in the setup chapter, then a "Try it" challenge that proves you understood it — with worked solutions in the back when you get stuck.

Part I — Fundamentals. Drawing, shapes, color, transforms, the game loop, delta time, keyboard, mouse. Eight chapters, eight tools you'll use forever.

Part II — Build Breakout. A paddle, a ball, bricks, collision, game states, score and lives — a real game, assembled a chapter at a time, with the arithmetic explained down to the pixel.

Part III — Make it feel good. The architecture chapter that reshapes how you think about game code, then particles, screen shake, easing, synthesized sound, and sprite animation — the "juice" that separates a demo from a game.

Part IV — Finish it. The complete Breakout with three TODOs only you can fill, then a sandbox with starter plans for Pong, Snake, and Asteroids. The training wheels come off.

Plus three appendices: worked solutions to every challenge, the compact helper library the capstone uses, and a glossary of every term the book leans on.

Who it's for: programmers who know basic JavaScript (variables, functions, loops) and want to finally understand how games actually work — not how to operate an engine. No prior graphics or game experience assumed. The whole toolchain is a text editor and a web browser.

Author

About the Author

Contents

Table of Contents

Preface

  1. What you’ll build
  2. How to read this book
  3. What you need

Your Workbench

  1. The routine
  2. What the boilerplate actually does
  3. If something breaks
  4. Part I — Fundamentals

Chapter 1: Hello, Canvas

  1. Try it

Chapter 2: Shapes & Paths

  1. Try it

Chapter 3: Colors & Style

  1. Try it

Chapter 4: Transforms

  1. Try it

Chapter 5: The Game Loop

  1. Try it

Chapter 6: Delta Time

  1. Try it

Chapter 7: Keyboard Input

  1. Try it

Chapter 8: Mouse Input

  1. Try it
  2. Part II — Building Breakout

Chapter 9: The Paddle

  1. Try it

Chapter 10: The Ball

  1. Try it

Chapter 11: AABB Collision

  1. Try it

Chapter 12: Bricks

  1. Try it

Chapter 13: Brick Collision

  1. Try it

Chapter 14: Game States

  1. Try it

Chapter 15: Score & Lives

  1. Try it

Chapter 16: The Shape of a Game

  1. Failure: render writes to state
  2. Failure: update draws to the canvas
  3. Failure: no single source of truth
  4. You’ve been doing it all along
  5. Try it
  6. Part III — Polish

Chapter 17: Particles

  1. Try it

Chapter 18: Screen Shake

  1. Try it

Chapter 19: Easing & Tweening

  1. Try it

Chapter 20: Sound (Web Audio)

  1. Try it

Chapter 21: Sprite Sheets

  1. Try it
  2. Part IV — Capstone

Chapter 22: Finish the Breakout

  1. Try it

Chapter 23: Sandbox

  1. Try it

Chapter 24: What You Built

  1. Drawing
  2. Motion
  3. Input
  4. Collision & State
  5. Polish
  6. Where to go next

Appendix A: Challenge Solutions

  1. Chapter 1: Hello, Canvas
  2. Chapter 2: Shapes & Paths
  3. Chapter 3: Colors & Style
  4. Chapter 4: Transforms
  5. Chapter 5: The Game Loop
  6. Chapter 6: Delta Time
  7. Chapter 7: Keyboard Input
  8. Chapter 8: Mouse Input
  9. Chapter 9: The Paddle
  10. Chapter 10: The Ball
  11. Chapter 11: AABB Collision
  12. Chapter 12: Bricks
  13. Chapter 13: Brick Collision
  14. Chapter 14: Game States
  15. Chapter 15: Score & Lives
  16. Chapter 16: The Shape of a Game
  17. Chapter 17: Particles
  18. Chapter 18: Screen Shake
  19. Chapter 19: Easing & Tweening
  20. Chapter 20: Sound (Web Audio)
  21. Chapter 21: Sprite Sheets
  22. Chapter 22: Finish the Breakout
  23. Chapter 23: Sandbox

Appendix B: The Helper Library

  1. The API at a glance

Glossary

Get the free sample chapters

Click the buttons to get the free sample in PDF or EPUB, or read the sample online here

The Leanpub 60 Day 100% Happiness Guarantee

Within 60 days of purchase you can get a 100% refund on any Leanpub purchase, in two clicks.

See full terms...

Earn $8 on a $10 Purchase, and $16 on a $20 Purchase

We pay 80% royalties on purchases of $7.99 or more, and 80% royalties minus a 50 cent flat fee on purchases between $0.99 and $7.98. You earn $8 on a $10 sale, and $16 on a $20 sale. So, if we sell 5000 non-refunded copies of your book for $20, you'll earn $80,000.

(Yes, some authors have already earned much more than that on Leanpub.)

In fact, authors have earned over $15 million writing, publishing and selling on Leanpub.

Learn more about writing on Leanpub

Free Updates. DRM Free.

If you buy a Leanpub book, you get free updates for as long as the author updates the book! Many authors use Leanpub to publish their books in-progress, while they are writing them. All readers get free updates, regardless of when they bought the book or how much they paid (including free).

Most Leanpub books are available in PDF (for computers) and EPUB (for phones, tablets and Kindle). The formats that a book includes are shown at the top right corner of this page.

Finally, Leanpub books don't have any DRM copy-protection nonsense, so you can easily read them on any supported device.

Learn more about Leanpub's ebook formats and where to read them

Write and Publish on Leanpub

You can use Leanpub to easily write, publish and sell in-progress and completed ebooks and online courses!

Leanpub is a powerful platform for serious authors, combining a simple, elegant writing and publishing workflow with a store focused on selling in-progress ebooks.

Leanpub is a magical typewriter for authors: just write in plain text, and to publish your ebook, just click a button. (Or, if you are producing your ebook your own way, you can even upload your own PDF and/or EPUB files and then publish with one click!) It really is that easy.

Learn more about writing on Leanpub