The lander has to pass through a red rectangle on the surface as it accelerates to the surface. Left and Right keys move it sideways and the up key gives it a boost. When the lander passes through the red rectangle it makes a noise; if it misses (or after it passes through the rectangle) it resets to a new position and starts again.
Two images were needed
- The lander image came from https://www.kissclipart.com/apollo-program-apollo-lunar-module-lander-moon-landing-wgwzny/ shared by Xfanmy. This needed to shrunk by about x10 to fit.
- Surface came from Vector Designed By from Pngtree.com
An image from the game, the code and a link to the repository are shown below, please feel free to unzip the code and use it. It is a simple game and there is scope to improve (please feel free to do it - I would love to see it improve).
Repository https://github.com/scottturneruon/moonlander/archive/v1.0.zip
Resources
- Welcome to Pygame Zero https://pygame-zero.readthedocs.io/en/stable/
- Introduction to Pygame Zero https://pygame-zero.readthedocs.io/en/stable/introduction.html
- Built-in Objects - Pygame Zero https://pygame-zero.readthedocs.io/en/stable/builtins.html
- Space Asteroids - Pygame Zero http://www.penguintutor.com/projects/docs/space-asteroids-pgzero.pdf
- Pygame Zero Invaders https://www.raspberrypi.org/magpi/pygame-zero-invaders/
- Pygame Zero: SpaceInvaders II https://www.raspberrypi.org/magpi/pygame-zero-space-invaders-ii/
- My first PyGame attempt https://robotsandphysicalcomputing.blogspot.com/2019/07/my-first-pygame-zero-attempt.html
- Moon Hacks https://moonhack.com/
Cool book on the Moon Missions with Augmented Reality
All opinions in this blog are the Author's and should not in any way be seen as reflecting the views of any organisation the Author has any association with. Twitter @scottturneruon