MichD

 

CarGo: Programming Web Game

CarGo is a web game around a custom mini programming language. You program a car to drive through a maze, avoid crashing, and pick up credits.

Similar to the “Brainfuck” interpreter I’d built the year before, I wanted to explore interpreting code a bit more. I remembered back in school we played with a programming tutorial in IT class. It was similar in concept, but had quite a bit more depth, of course.

I developed some core ideas of what I wanted in the playing field. Walls and the finish were obvious, credits you picked up seemed like another good addition.

The codebase is split into distinct components that are all fairly self-contained. The system is built around a centralised event dispatcher, allowing each component to publish and subscribe to events as necessary.

I built the proof of concept with 3 different puzzles, out of which only the last one being somewhat of a challenge. It would’ve been cool to develop the concept further, adding a level editor, a backend to allow sharing levels and high scores, but I had lost interest by that point.

This project was done in my spare time over the course of about 3 weeks.

Work Involved

  • Concept design
  • Simple programming language design
  • Code parser development (heavily regular expressions-based)
  • Semantic representation of code into what I guess you’d call a sort of syntax tree?
  • Development of game entities such as car, cell, grid, game
  • User interface development, tying in with rest of program
  • Graphic design (images used in-game, designed in Inkscape)
  • CSS styles for overall look and feel