Saturday, December 8, 2012

DEV DIARY: Making a memory puzzle game

As much as I enjoy playing other people's games, I also very much enjoy the challenge of trying to create games myself. Recently, I finished up a little memory game I'd been working on. It was something I started originally as more of a programming exercise than anything else. Remember those old Simon electronic games that were big in the '80s? I never actually had one as a kid, but I knew the basic premise: it would play four different colored lights in a particular sequence, and then the player had to repeat that sequence. Every time the player succeeded, the device generated a longer sequence. 

Well, the great folks over at r/dailyprogrammer thought programming a clone of this device would make for a nifty little challenge for its readers, and I decided to take that challenge on. Much to my surprise, I was rather quickly able to create a very simple Simon web game using JavaScript and some not-terribly-fancy html/css work. There were a few differences from the original Simon: in my game there were 6 colored boxes instead of 4, and instead of  building up on one sequence consecutively, my game would simply generate an entirely new sequence for the player until the player finally made a mistake. It was pretty easy to create... and also pretty boring to play. So I started to wonder if there was a way to spice that up.

I decided there were two things that I wanted to implement in an effort to make this little memory game into a more compelling experience. First, I wanted to create a story for it. It might just be my personal aversion to pure puzzle games that drove me to do this, but I wanted to give some kind of context for all that button pressing. Secondly, I wanted to try and complicate the memory puzzles. I wasn't sure what kind of game mode the old Simon games featured, but I had played a few of the recently popularized n-back memory games (which I've written about before in my Lumosity review) and found them to be quite challenging. I wondered if there was a way to take the basic repeat-after-me mechanic and give it a bit of the same oomph of the n-back.

So with those goals in mind, I spent the last two weeks dressing up my simple little Simon clone and created the webgame, Escape Planet Simon-2317.  As the name suggests, I went with a bit of a sci-fi flavor for the story behind the game, and I programmed several variations to the actual gameplay: there's the basic repeat-after-me, a mode in which the player needs to repeat the sequence in reverse, and a mode in which the game prompt the player to repeat the sequence in a randomly specified order. The later stages of the game felt fairly challenging to me, and truthfully, I'm not sure I can beat my own game. Ultimately however, I don't think that the game manages to recreate the rigor of a true n-back/dual n-back test (and thus who knows if there are any real mental benefits is playing Escape). But I will say that in programming and debugging the game, I definitely felt like I was getting better at keeping the sequences in my head. Perhaps even with a fairly simple memory game, practice can help make small improvements?

I know I definitely got my fair share of mental exercise in making this game, but I'd love to hear how it could be made better. If you decide to test it out, please leave a comment and let me know what you think!

2 comments:

  1. The game crashes during the course

    ReplyDelete
    Replies
    1. Thanks for the bug report! I'll have to look into this. Any more details (when precisely the crash occurred and what browser you were using) would be appreciated.

      Delete