Intro
Have you ever imagine being in a spaceship looking at the stars flying through you? This project might make the scene alive on your computer!
GIFs
Github Repo & Links
Visit the Github Repo for this project
Project inspired by:
-Processing Examples At cs.brynmawr.edu
-The Coding Train
Features
- Stars flying from far gets larger when closer
- Be a time controller! Move the mouse to control the speed
- You may select whether seeing the trails
Controls
action | control |
---|---|
Speed Up | Move The Mouse To Right |
Slow Down | Move The Mouse To Right |
Dependencies
You will need the pygame
package for this game.
1 | $ pip install pygame |
Run
Download the shooting_stars.py
file or clone this repo and run it in the terminal.
1 | $ python shooting_stars.py |
HOW To Create Your Version
init the frame
1 | width = 500 |
class definition of Star
1 | ## Star class |
show and update function for a list of Stars
1 | ## show stars and update the speeds |
initialize a list of Stars with a given number and run the main loop
1 | ## initialize the stars, you may change the number of stars |
Conclusion
Enjoy your journey in the universe! Make sure to create a version yourself!
Improvements you can make
- add different colors or shapes to the stars
- make the scene three-dimensional
- add a spaceship model
- …