Python version of my Lunar Lander implementation for the Fundamentals of Computing course
This project is a translation of Alex Ayala's Lunar Lander project from Fundamentals of Computing. The original project was written in C++ and this project is written in Python 3 using Pygame Zero. The inspiration for this project came from a desire to translate Alex's old code into an updated Python version. Our end goal for this project was to have a working game with improvements from the old version. Some updates that we included were the addition of sound and updated fonts.
There are two ways to install the project. One is via a package and the next is via cloning the GitHub repository.
The package has almost all of the necessary files to run the game. You need to have Python 3 and Pygame Zero installed. Next, you need to download the font pack to get the game to work. The instructions to do that are found in this readme. Feel free to view the official release as well.
Click here for the tar package.
Click here for the zip package.
To install the project via Git Cloning, clone the GitHub repository. Make sure that you have the latest version of Python 3 and Pygame Zero installed. Next, you need to download the font pack to get the game to work. The instructions to do that are found in this readme.
The old C++ files that our project is based off of can be found in the cppLander folder in our repository.
To run the program, double check that you have Python 3 and Pygame Zero installed.
Our main python file is lunarLander.py
.
Next, simply run the command python3 lunarLander.py
within the project directory from your command line such as (Terminal for MacOS, Bash for Ubuntu, etc.)
Below are screenshots from the game.
To play, use the arrow keys to control the ship as shown on the photo above. The other instructions are above in the title page.
Here is what the screen will look like during normal gameplay.
The rocket gets a certain amount of fuel per round. When the fuel expires, the game is done. The image above shows the screen when you run out of fuel.
If you land too fast or don't land with the ship in a vertical angle, you will crash the ship. You also lose 100 fuel units. You automatically get 5 points on a crash.
If you land with a vertical speed between -13 and -25 and a horizontal speed between -25 and 25, you will earn15*multiplier
points. This is a hard landing.
If you land with a vertical speed between 0 and -12 and a horizontal speed between -25 and 25, you will earn50*multiplier
points and 50 extra fuel units. This is a good landing.
To contribute to this project, familiarize yourself with Lunar Lander, this version of the game, and Pygame Zero. If you have found an issue or want to add any features, create an issue within the issues tab of the GitHub repository. If you would like to contribute your code, make a pull request to the project to be reviewed by the project maintainers.