The skybox effect and changing of the hours


One of the things I really wanted to do with this game was a have a really cool night and day cycle. I've worked on them before, and I know the basics (slowly fade in a night overlay to get towards night, with ambient lighting making "holes" in the overlay, and then fade it out when it gets towards day), but I also wanted to have some other features, since this would be a platformer. And really, this is the first true platformer I've ever worked on. Until this game I've mostly done overhead style games, like zelda and final fantasy, etc. I decided I really wanted to push my skills with this one and learn new things, hence making a platformer.

I'm really glad I did. So many cool things I figured out when making this game, and it def challenged me in the sprite making department. I had to get out of my comfort zones, and that was a good thing. So a few of things I knew I wanted to do with this game-

I wanted multiple parallax scrolling layers, both in the foreground and the background. I did some simple math so that I could specify how close the layer is to the main game camera and how far away, and that would change the speed as well as tinty and slightly blur the background. Farther away, move slower and slower (and tint towards light blue and slightly blur). Closer to the camera, no blur or tint, and move faster than the main camera.

This worked out excellently. One of these days, if I have some time, I'll add some images showing you exactly how this worked. I also decided I wanted scrolling clouds far in the distance. I know for these, the best effect would be to have them not move with the camera, but instead on their own. Like how the sun in the distance seems to stay in the same part of the sky. So I took my basic cloud animation I made about 6 years ago, and layered it up so it was four layers of clouds, each cloud moving at it's own speed, and then a blue sky behind it. This was basically a skybox, like how it's used in 3d games, but for a 2d platformer.

Then, I decided I wanted weather effects in the game. The usual storm effects would require a cloudy overhead, so I added a layer of clouds that would fade in behind the normal clouds (and obscuring the blue sky), and would fade out when the storm was over. Slowly tint the world a dark blue as the clouds rolled in, and then created a simple rain particle effect. I drew a rain drop animation, and then had it randomly appear on the screen at different places, and the heavier the storm, the more rain particles. A simple idea, but it works well. I didn't use Love2d's in system particle engine for this, it seemed like an overkill. A pretty simple randomized place rain and slowly remove rain worked wonders.

Then I decided I needed a fog effect, too. I decided to do something interesting, since this was a platformer. I took my cloud graphics, made them a darker bluish grey, and then stacked them and scrolled them slowly over the foreground. It looked like fog rolling in, and was fantastic. I don't think I'ver ever seen a game use a fog effect like this before, and I really loved how it looked.

Now to return to the night and day cycle. I wanted stars to slowly appear in the sky, so I did a basic starry sky pixel image the size of the screen. I then placed this behind the sky box, and I had the blue sky slowly fade out when it turned to night, and then slowly faded in the night layer ontop of everything else. This gave the effect of stars slowly appearing in the sky during the evening, and then full out when it turned to night. I'm really happy how this turned out, and probably my favorite effect in the game. It feels beautiful and moving, watching the stars come out at night. Esp if it's a foggy night, and the fog is rolling and the stars are twinkling...

It's super cool. Probably my favorite thing in the game hands down.

Get Emberglass

Buy Now$5.99 USD or more

Leave a comment

Log in with itch.io to leave a comment.