Making the Starfield app

Armed with our newfound knowledge of GLSL, let's build a starfield screensaver, that is, a non-interactive demonstration of stars fleeing from the center of the screen to its sides, under the influence of an imaginary centrifugal force or something.

Tip

As dynamic visual effects are hard to describe unequivocally and screenshots aren't very helpful in this regard either, run the code that accompanies the chapter to get a better idea of what's going on.

Conceptually, each star goes through the same action sequence:

  1. It spawns randomly near the center of the screen.
  2. The star moves in the opposite direction from the screen center until it's no longer visible.
  3. Then it respawns, going back to square one.

We will also make stars accelerate ...

Get Kivy Blueprints now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.