Fun With Canvas

Jun 24, 2015 in games, computers

Recently, I’ve been trying to get away from using Flash to make games. It seems like a relic from a bygone era. As such, I probably need to start learning to write games in HTML5 or something. Today, I’m messing around with the <canvas> tag.

But unfortunately you aren’t using a browser that supports the canvas tag. That’s too bad.

It's a little level editor, implemented in 44 lines of Javascript. (And it could be less if I shrunk it down.) Granted, I used jQuery for some of it, and it doesn't do very much, but I doubt I could have done much better in Flash. And, unlike Flash, this thing has the advantage of being cross-platform. So I think this is pretty nice.

You select which thing you want to place using the buttons at the bottom, then click on the image to place that tile in that place. If you want to save your level for some reason, you can right-click on the canvas element and hit 'save image.'

I may discuss later how I built this. I will also make some more weird canvas experiments. Wish me luck!