The flashing siren lights in the title screens for Police Quest 1 and 3 are sort of interesting, because they are not quite a simple matter of calling
(Palette palANIMATE) once or twice. In fact it’s called eight times each frame! Here’s the final result:
And here’s the
Script at the heart of it:
(instance cycleColors of Script (method (changeState newState) ; Fun fact: the switch isn't actually needed. ; Not in this use-case. (switch (= state newState) (0 (Palette palANIMATE 208 213 1) ;blue in the middle (Palette palANIMATE 213 218 1) (Palette palANIMATE 218 223 1) (Palette palANIMATE 223 228 1) ;blue on the side ; Note that we're switching from 1 to -1 now. (Palette palANIMATE 229 234 -1) ;red in the middle (Palette palANIMATE 234 239 -1) (Palette palANIMATE 239 244 -1) (Palette palANIMATE 244 249 -1) ;red on the side ; Almost immediately do it all over again (= cycles 10000) (= state -1) ) ) ) )
The palette here has a very particular setup. The lowest colors, #208 to #249, are set up like this:
Each of the eight siren colors in the image has its own four-step palette, individually rotated! It looks kinda like this:
If that one black entry wasn’t in the way between blue and red, it’d line up better, but what can you do?
What’s particularly funny about this is of course that no SCI interpreter with fewer than 256 colors implements this feature.
cycleColors script is still there and is still invoked. Just like with the chronostream animation in Space Quest 4.