Parallax scrolling is a common animation trick that produces an illusion of depth by having different layers of graphics scrolling at different rates. The more slowly-moving layers appear to be further away. For this badge, you're going to use this trick to create a parallax-scrolling starfield.
Create a Mini Micro program that does the following:
- Sets display(6) to pixel mode in addition to the standard display(5).
- Clears both displays to color.clear, with a size of 960 pixels wide and 1280 (i.e. 640*2) pixels high.
- Defines a function to draw 500 randomly-colored stars on a given display, using setPixel.
- Uses that function to draw stars on both display(5) and display(6).
- Enters an infinite loop which (a) scrolls display 5 in Y by 2 pixels, wrapping back to 0 at 640; (b) scrolls display 6 by 1 pixel, also wrapping at 640; and (c) yields.
When run, you should see two different layers of stars, scrolling down the screen at different rates. Submit your program to earn this prestigious badge!