Tag Archives: Canvas

Conway’s Game of Life

Conway Banner

I love Conway’s Game of Life and I’ve made a version in pretty much every language I’ve ever learned, including QBasic. So a Javascript implementation was pretty much inevitable…

This was my first time bringing in HTML elements outside the canvas to control the simulation, and I also integrated a third-party slider component from DHTMLX.


Fun with graph theory: Wilson’s Algorithm

Wilson Banner

The mini javascript projects continue apace. Today’s little program: an implementation of Wilson’s Algorithm.
Read More →


“Bubbles” canvas tutorial part 4: Getting noisy

HTML5 Bubbles 5

Now we’ve got graphics, animation and interactivity, what’s left? In this final part of my HTML5 javascript/canvas tutorial we finish off our little game by adding some sound effects – what good is popping bubbles without the satisfying sounds of destruction? Unfortunately, adding audio is far trickier than it has any rights to be, so hopefully this tutorial will save at least one person the troubles I had to go through.
Read More →


“Bubbles” canvas tutorial part 2: Getting animated

HTML5 Bubbles 3

In the first part of this series we set the stage by putting together our framework and then getting a simple background on screen. This article will add our rendering loop to the code and let us actually get some bubbles out there.
Read More →


“Bubbles” canvas tutorial part 1: Getting started

HTML5 Bubbles 2

When I started this little project I had only a vague idea of how it would look and even less of an idea how it would be written or structured. As it turned out I just slapped down a quick gradient background, came up with a simple Bubble class and set a timer to move the bubbles up the screen. That gave me a basic core to work from, but as I started to tweak and add I realised just how messy it was, even for a simple project like this.

So this tutorial is going to ignore all my mistakes and lead you gently to the finished version with something resembling logical sense. This entry in particular will focus on giving us a basic framework to work within, and go as far as putting a background on screen. Part 2 will introduce the render loop and actual animation.
Read More →


“Bubbles” canvas tutorial: Introduction

HTML5 Bubbles

After my early forays into canvas and Javascript I commented on Twitter how good it felt to be learning something new, something that felt like it opened up a whole new toolbox to me and the attendant possibilities.

The main upshot of this is that I finally have the tools at my disposal to make the game I’ve been promising my two-year-old son for a while now. This project is ongoing but “functionally usable” now. It hit a few bumps along the road so I’m writing this series of articles to describe the development of the game, the problems I encountered and how I overcame them.
Read More →


A whole bunch of HTML 5

HTML5 Canvas Banner

The last animation I posted was just a work in progress, halfway to something a little more complex. As promised, here’s the fruits of that work. I’ve put together a page of my little collection of animations.

Mostly this was an excuse to put up another of my HTML5 logos with the stolen XKCD people.


More fun with the HTML5 canvas

HTML5 canvas - not as confusing as prototypes

Oh go on then. Here’s another canvas animation. It’s pretty simplistic but so far it’s just a work in progress of something more fun. And after that, some thoughts on what comes next on a technical level.
Read More →


First steps in HTML 5 – Getting to grips with the canvas

HTML5

Today I discovered r/loadingicon and promptly spent an unwise amount of my precious free time staring mesmerised at the screen. When I finally snapped out of it I finally resolved to actually sit down and learn how to use the HTML5 canvas element. I’m not claiming to have the arty chops of the people posting those icons, but it seemed like a really fun way of getting into the spirit of things.

And you know what? Basic canvas drawing with Javascript is easy. Really, really easy. An hour later I had something I’m going to call halfway fun to sit and stare at.
Read More →