New Games Section and Articles
March 17, 2016
TLDR: New Section! Games!
My first 'game' is robotfindskitten, a clone of the zen simulation 'game' where you play as a robot, represented by a
# and you have to find a kitten by touching things to figure out what they are.
It's very simple, but includes most of the basics of a 2D game: the standard event loop, generating and updating a game state, input, rendering to screen, and collision detection.
I've used SVG graphics a lot in the past, so this was my first real experience with
Overall, I found the experience fairly straightforward.
I've used SFML and C++ to do some graph layout in the past, so the rendering strategy wasn't entirely foreign, although I learned some basics about sprite-based rendering.
For robotfindskitten I rendered individual items (from text symbols) to off-screen canvases once at start-up and then re-rendered from the off-screen canvases to the main canvas after blanking the main display each frame.
This is the basic sprite rendering flow and worked just fine for the simplicity that is robotfindskitten.
Performance improvements (in the general case, but not needed here) could come from batching or re-using sprites to reduce the number of DOM elements used, and partial re-painting.
In the case of batching, I could use a single off-screen canvas for all the sprites, and just store a position off-set and (width, height) pair to grab the sprite from.
Even better, since only the robot moves, it would make sense to repaint only the robot on updates.
Everything works find as it stands, although there are a few bugs (random generation of stuff can sometimes cause things to overlap) that I'm not planning to fix, as I would rather work on a new project at this point.
I may add the partial re-draw though.
As for the next game, I'm considering either a basic shooter or an infinite runner. I'm leaning towards the shooter as I think the animation and art will be easier, while the programming will be a little harder than the runner. I'm imagining a classic space shooter, so static ship sprites without much (drawn) animation. I may also do an incremental/clicker, but I've lost my personal taste for them, and they don't push real hard on the skills I most want to work on right now, namely graphics programming and art.