Lighting Effect - How to Make a 2D Game in Java #44
In this video, we implement darkness and lighting effects that are provided by torch or lantern so we can create nighttime situations or dark interiors such as dungeons, caves, ruins, etc.
There are many methods to add lighting effects and this time we apply a so-called smooth lighting/soft lighting effect by utilizing Area, Rectangle2D, Ellipse2D, and RadialGradientPainclass.
Thanks for watching.
Timestamps:
0:00 Introduction
0:45 Creating EnvironmentManager and Lighting class
3:30 What we're gonna do (Summary)
4:57 Creating a rectangle with a hall in the middle
14:12 First result (Spotlight effect)
14:56 Creating a gradation effect
21:20 Second result
22:24 Changing the size of the lighting area
23:37 Conclusion
#javagamedev #javagametutorial