- Get link
- X
- Other Apps
In this mini tutorial we are going to be making a flickering light using OpenSimplex noise to generate random values instead of just using rand(). This will ensure that each value produced isn’t too far off from the last value, making the light smoothly travel to different brightnesses. OpenSimplexNoise is essentially an open source version of perlin noise.
So we initialize a new OpenSimplexNoise and feed a value to it every time _physics_process is called, then it spits out a value which we use to set our alpha transparency.
We increment value by 0.5 every cycle in this example but feel free to tweak this or any of the numbers to see what happens.
If you are using a Sprite instead of a Light2D you can simply change self.color to self.modulate and it should have the same effect.
Comments
Post a Comment