2D Light and shadow effects - 2.0.0
Create 2D light sources onto a pygame surface and generate shadows using polygon layer
Berenguer
(Yoann)
This program creates 2D light effects onto a pygame surface/image (32 bit PNG file encoded with alpha channels transparency) and generate shadow.
Changes
The class can be easily implemented into a 2D game (top down or horizontal/vertical scrolling) to enhanced the lighting ambiance.
Version 2 changes :
Added volumetric effect (animated smoke or plasma) in the illuminated area to set a specific ambiance. This effect can also be used for generating force field aspect around a set point.
Added warning light (rotational lighting)
Implemented shadow projection effects from a light source coordinates (See file Shadows.py for more details and credit to Marcus Møller for its shadow algorithms (https://github.com/marcusmoller).
Code clean-up and split the code into different modules Constant.py LoadTextureFile.py Shadow.py LightDemo.py
DEMO available in the directory dist.
*** The assets directory must be in the same location than the executable file
Links
Releases
2D Light and shadow effects 1.0 — 18 May, 2018
2D Light and shadow effects 2.0.0 — 18 May, 2018