Here is the "color=" part of the script menu of the yellow light:
{((sim.time % 12 > 4 && sim.time % 12 < 6) || (sim.time % 12 > 10 && sim.time % 12 < 12)) ? [1, 1, 0, 1] : [1, 1, 0, 0.2]}
Everything has to be put into {} to be stored as a continous script.
sim.time - a timer that counts how long the scene has been running
(sim.time % 12 > 4 && sim.time % 12 < 6) means: in a period of 12 seconds (0-12, 12-24, 24-36...) more than 4 and less than 6 seconds (4-6, 28-30, 40-42...)
&& = AND
|| = OR
? = IF-THEN
: = ELSE
[1,1,0,1] = [red=1, green=1, blue=0, opacity=1] = yellow
[1,1,0,0] = [red=1, green=1, blue=0, opacity=0.2] = transparent yellow
If you use lasers, for better performance, set the turned off light opacity to 0.
Everything in words:
If in periods of 12 seconds the time is (more than 4 and less then 6) or (more than 10 and less then 12), the color should be yellow, else transparent (no light)
Basis:
{ ( (A) || (D) ) ? [c1] : [c2] } = if A or D are true, the color will be [c1], if not true (else), the color will be [c2]
If it should light once per period, the basis would be:
{ (A) ? [c1] : [c2] }
I know that this is just a trifle compared with thousands of other really EPIC scenes. This was an exercise for improving my thyme.
Thanks you all for your comments!
The box accelerates while you are holding the arrow key. When you release the arrow key, you don't stop moving, you just have a constant speed.
Redshift in this simulation is due the speed, not acceleration or distance. So, the wavelength stays the same, but if we subtract the speed of the box from the speed of light, we get a ostensibly lower speed of light.
Thank you for your replies! I know for some bugs. It will be fixed.
The circles may not lose energy because the friction is set to 0, the donut is round and their velocity vector vertical to the collision/overlapping force which is has like attraction the direction to the center of the donut.
Nice discovery