My team and I have been working on a game in Java using the Slick2D engine and there are a few things I have questions on. As of right now, the code that I've written basically takes a cosine function and gets a value based on the current game time (which is normalized by some multiple of Pi, like 4*Pi, to give us a period (or day length) of 4*Pi). The value that comes out of the function is used directly as the alpha level of the overlaying light layer so that as the night comes on, the screen darkens until it's completely opaque, then eventually comes back to completely transparent. I've also created a mask around the player, which disallows the alpha level from drawing near the player.
Now, this looks cool and all, but if I want to draw different alpha levels around that, some that may even be non-existent until it begins to get dark like an average alpha transition that goes from the 100% transparent alpha near the player to the 100% opaque alpha outside that mask during the pitch black of night, I run into issues. Screenshot
Basically, Slick provides some tools, like static values in the Graphics class that change the draw mode. Examples are: MODE_ADD, MODE_ADD_ALPHA, etc. I'm wondering if there's a particularly good rundown on using these to get results where I have alpha levels that will vary between the current overall alpha level and the 100% transparency so I can create clean transitions so it doesn't have that clean cutoff seen in the screenshot.
Or should I scratch this and go with a grid/cell based system since the game's tile based when it comes to drawing the background layers, save for the entities. Might make a bit more sense and look a little more natural with the backgrounds, although still look a tad unnatural.
EDIT: I'd also be open to other paradigms.