Saturday, 20 July 2019

Simple PyGame Zero Apollo Lander #Apollo50th

With all the excitement of the 50th Anniversary of the first Moon Landing and the world record attempt Moonhack https://moonhack.com/, I wanted to experiment with PyGame Zero a little more. So I created my own, very simple, Moon Lander game using Python and PyGame Zero.

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




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
  1. Welcome to Pygame Zero https://pygame-zero.readthedocs.io/en/stable/
  2. Introduction to Pygame Zero https://pygame-zero.readthedocs.io/en/stable/introduction.html
  3. Built-in Objects - Pygame Zero https://pygame-zero.readthedocs.io/en/stable/builtins.html
  4. Space Asteroids - Pygame Zero http://www.penguintutor.com/projects/docs/space-asteroids-pgzero.pdf
  5. Pygame Zero Invaders https://www.raspberrypi.org/magpi/pygame-zero-invaders/
  6. Pygame Zero: SpaceInvaders II https://www.raspberrypi.org/magpi/pygame-zero-space-invaders-ii/
  7. My first PyGame attempt https://robotsandphysicalcomputing.blogspot.com/2019/07/my-first-pygame-zero-attempt.html
  8. 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

3 comments:

Who wants to produce AI produced cartoon strips

Question: How easy is it produce a comic/cartoon using genetative AI? Let's start with  using ChatGPT4o to produce cartoons. The idea wa...