The Dark Mines project lay dormant for a good many month until I picked it up again. Probably not a terribly smart idea considering that I’m simultaneously working on two other big projects at the same time (X-files board and role playing game, and Ld50 Larp event) but who cares!
After playing a couple of levels I decided that I did not like the way that traps emit darkness. If you look really carefully at the lights around a trap, you can see that there is less light around it than you might expect. But the difference is hard to see, and that is not the point of the game. You should be apprehensive whenever you encounter darkness. ‘What will it be? Danger or reward?’ But right now it’s so hard to spot that any apprehension is not likely to happen. So I gimped a mock up of what I wanted: that the edge of the dark area be visible as an orange shine. A sort of aura around the darkness.
Some weeks later I implemented this in the form a circle of light that is placed at the edge of the dark area. On the way I learned some more about the subtleties of the gimp and how Java handles bitmaps. I also had to make some additional engine changes. First of all JGame does not like sprites with alpha values.
Side tangent: did you know that the PNG format and the standard Java image library natively support an alpha value for each pixel? This means that you can have nice soft edges on your sprites… or that you can create a nice aura bitmaps for your darkness. The Gimp handles these alpha values as well (of course).
As said: JGame takes special care to remove any alpha values and once I found that out it was trivial to remove that code. Secondly JGame can only parse a 1D strip of images, not a 2D grid. I created my aura as a single image from which JGame could create the sprites so I wrote a little utility that converts 2D image grids into 1D image strips. I may consider to rewrite how JGame loads images to have it natively support grids of images, but this would require me to tinker with the configuration engine, and I don’t want to do this just now.
In the end, I have a mechanism that overlays the edge of a dark area with tiles from the aura. And I am very pleased with the results!
The aura only shows up in tiles that you have a line of sight to. And it works! In test runs I now see the aura of a trap clearly, and have to consider how to move around it.
Leave a comment