SimpleCanvasLibrary

TomHinkle.net

SimpleCanvasLibrary

A simple canvas library for teaching JavaScript to students who want to write games.

After a few years trying to teach introductory JavaScript to students using libraries like Phaser, I decided to roll my own library for teaching.

The goal here is to make very simple game development as easy as possible while keeping students relatively close to the Browser API.

As a teacher, I'd rather students figure out things like how to represent gravity or velocity on their own, so sometimes the game engines that come with mature physics libraries provide too much help on the one hand and way too much complexity on the other. Students spend more time learning the library than learning the fundamentals of how to build on their own code.

SimpleCanvasLibrary is just a few hundred lines, a lot of that being documentation. I try to throw helpful errors for students who aren't used to reading errors, and I try to provide a simple API that makes it easy for students to get drawing on the Canvas in the first few days of class.

Here is a document I keep for my students with a list of YouTube tutorials and so on for using this library.

Note: this only landed in a github repo because I was fiddling with PhoneGap, but it looks like I never got it working. This is one of my first experiments with trying to get a web app turned into a phone app, and apparently it didn't go to well.

Tags

Tech used in this project:
JavaScript Game Canvas School