day nigh cycle

For this nice effect i prepared 4 gradient textures for transition between night -> morning -> day -> evening -> night.
Then each time a transition was going on i render two full size textures with gradient. The first ending texture for example is morning and alpha goes from 1 to 0. And the next texture above this morning gradient is day and alpha goes from 0 to 1.
The blending i used was love.graphics.setBlendMode(“alpha”,“alphamultiply”) in that case the colors looked nice.
This shows only the background sky change and it is not enough when you have screen full of layers and sprites. So in the next step i added an over layer drawn as last background with alpha and fully black. The alpha goes from day 0 to night 0.8. Thus simulating dark screen.
There is no need for adding moon and sun rising/falling. I tried it and this only adds an object that is nice looking but will not help the scene because the objects can overdraw easily such big sprite.
So let’s prepare with this and next time i talk about the light layer where i put candles, lamps, fire objects and various small light. This time without generating any shadows from corners. Just a simple light effect layer for the game to look better at nights.
LUA game developing for dumbies
Some nice ways of doing the lua game developing .
Status | In development |
Category | Other |
Author | Bastian |
More posts
- exporting1 day ago
- light and shade3 days ago
- angles and the great distortion16 days ago
- game making17 days ago
- collision21 days ago
- classes and oop29 days ago
- trajectories30 days ago
- fullscreen (LÖVE2D only)32 days ago
- general base of project33 days ago
Leave a comment
Log in with itch.io to leave a comment.