Fork me on GitHub


Here I shall go quickly through the 7-day development of A Little Anxious When It's Dark and explain what I think was particularly succesful and what was not.


I had a vague idea that for my 2011 7DRL challenge entry I wanted to create a roguelike that would utilize OpenGL for creating some nice lighting effects as well as render the scene in 3D, although still from a top-down perspective. A few days before the challenge I took interest in WebGL, the brand new standard bringing hardware accelerated OpenGL ES 2.0 to web browsers without any plug-ins. I didn't know much JavaScript (which is what is used for accessing WebGL), but after I spent a day messing around with some tutorials from, I realized this could very well work!

Getting an @ to move on the screen

I started the challenge on Saturday, March 5th at 15:15. My starting point was a tutorial code that I had modified rather heavily underneath, but on the outside it was still a spinning box type of thing. I created a very simple hard-coded map and rendered it using a single quad with texture repeat for floor and cubes as walls. I had some difficulties with coordinate systems and other stuff, but I finally got the @ moving as seen in the picture below.

Floor and walls

I'm on to something...

The basic moving @ actually took me a bit more time than I had anticipated, but after that point, the development got much more fun. Next up was adding some lighting, other than global ambient light. At first I used single point light that was attached to the player character. It took quite some time to get that working properly, but afterwards it wasn't a big task to create a system for handling multiple lights. By changing the light color to warm yellow, I got the picture below and realized I was definitely on to something...


I then decided to implement normal mapping to create some bumps on the flat surfaces. This turned out to be the single most difficult and time consuming task involving a lot of research and several shader rewrites. Once I got it working, I was very happy, although the visual results were rather marginal, especially for a still image as you can see below. Later on I quickly hacked a first-person mode where the normal mapping in the walls looks really cool with moving lights. In retrospect, perhaps the most important task of the normal mapping is to make the player character, monsters and items look 3D instead of boringly flat.

Normal mapping    First-person mode

I had already decided to make the walls taller than camera height, eliminating the need for FOV algorithms and light-bleeding countering shadowing calculations. The last big feature for the engine was to add some variance to the walls, i.e. break the straight lines. Result is shown below. This made the dungeon look rather nice to my eyes so that I could turn my attention to the actual gameplay.

Uneven walls


I had no big ambitions towards the gameplay and in fact, not very clear visions either. So I just started to build up the core features: monsters, fighting, AI and items. I ended up with a very few types of enemies and even fewer items, but I feel that they suffice. With regards to dungeon generation, I didn't really spend much time with it, simply porting an old "place-a-room-connect-with-previous-one-repeat" generator of mine to JavaScript. The results are not breath-taking, but adequete nevertheless. Along the road, the user interface around the dungeon view evolved and eventually I also got level transitions, an ending and a background story (if you can call a couple of sentences that). There were also improvements to the engine and other nice stuff - I've gathered some of these later stage development pictures below.

Map overlay     Interface
Portal     Blood splatter


What went right

Room for improvement

All in all, I'm very happy with the results and consider this a personal triumph (which creates some pressure for the next year's 7DRL challenge as I was already very pleased with my last year's entry, City of the Condemned).