Blockhead
Started: 12/1/2025
Completed: 12/5/2025
Blockhead is a recreation of the blockhead minigame found in the game Okami. I made this game in a burst of inspiration.
You can play it in the browser here
It's made with the HTML canvas and JavaScript which was partially fun to put together and partially a nightmare. The cool thing about that fact is that you can look at all of the source code for the game really easily in your browser. I've used the Love2D framework before, and using the HTML canvas is pretty similar in the types of features that you get out of the box (drawing shapes on the screen and getting keyboard and mouse input).
The weirdest thing to have to deal with is mouse input. The canvas has its own internal coordinate system based on how big it is. Everything that you draw on the screen is based on the canvas coordiate system. The canvas' cooridnate system is mapped onto the webpage based on the surrounding HTML elements and any css styling. When the game is reading mouse input, it measures it relative to the whole webpage, meaning that we need to convert the coordinates into the canvas' cooridnate system by applying the inverse of the canvas' translation and scale to the measured mouse position before we can use it.
Drawing things onto the screen is super easy, but having things animate nicely is a huge challenge: you have to build quite a bit of scaffolding in order to get things to work in a flexible and reusable way. Functionally, the game is very simple to implement, but to build nice visuals and animations on top of that takes quite a bit of work. I wanted to make the visuals vaguely inspired by how Okami does it, and I think that I did a reasonable job.
Sometimes, it's fun to go from being able to draw shapes on the screen to making a game that you can play, but anything more complicated than this would be quite the effort.