Skip to main content

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

Home Page
https://github.com/yoyoberenguer/LightEffect
Source
https://github.com/yoyoberenguer/LightEffect
Windows
https://github.com/yoyoberenguer/LightEffect
Mac
https://github.com/yoyoberenguer/LightEffect
Github repo
https://github.com/yoyoberenguer/LightEffect

Releases

2D Light and shadow effects 1.0 — 18 May, 2018

2D Light and shadow effects 2.0.0 — 18 May, 2018

Pygame.org account Comments

  • Reece Sharpe 2018-05-18 14:53

    Cool, I love this post, guys gave us so much space to create

    Berenguer 2018-05-25 06:54

    Thank you Reece, have a nice day