How can I do this effect in the BGE?

When slowing time down in the BGE, I would like all lights in the current scene to redshift and their energy levels to drop by half, thus simulating the Doppler effect. Then, if time speeds up, the lights get brighter and bluer, thus simulating the blueshift effect. How can I achieve this? I have already achieved slow motion, so how to recreate the light Doppler effect? Thanks!

1 Like

you can animate the light

You can get/set a time with the following Python methods:

KX_GameObject.getTimeScale()

&

KX_GameObject.setTimeScale(1.0)

You can get/set a lamp’s color and energy with the following Python methods:

KX_LightObject.energy = 1.0

&

KX_LightObject.color = [1,0,0]
1 Like

I mean ALL lights in a scene through Python. Not just one individual light. All of them. And it gets it through like scene.lights or something.

import bge

scene = bge.logic.getCurrentScene()

for light in scene.lights:
  light.energy = 0.5
  light.color = [1,0,0]
1 Like