I played with the idea more and was able to make a moving light source
by, each frame, making a solid black mask, using pygame.draw.circle to
draw a transparent circle on it, then blitting the holey mask onto the
screen. This turned everything black except where the light had been
placed, and
Kamilche wrote:
Try the following code. It uses a gradient light.
I'm trying to figure out how your example (much better than mine) works.
It looks like the key is the last line of this function:
def RefreshNight(night, alpha, light, x, y):
a = NIGHTCOLOR[3]
alpha.fill([a, a, a])
Kris Schnee wrote:
Kamilche wrote:
Try the following code. It uses a gradient light.
I'm trying to figure out how your example (much better than mine) works.
It looks like the key is the last line of this function:
def RefreshNight(night, alpha, light, x, y):
a = NIGHTCOLOR[3]
Kris Schnee wrote:
Kamilche wrote:
Try the following code. It uses a gradient light.
I'm trying to figure out how your example (much better than mine)
works. It looks like the key is the last line of this function:
def RefreshNight(night, alpha, light, x, y):
a = NIGHTCOLOR[3]