The goal of this assignment is to get some practice working with well-modularized code that follows the Model/View/Controller design principle.
This is an individual assignment.
Make a copy of your whole lander directory from last time; maybe call it lander2. You will be further modifying the code that you wrote and worked with in the previous assignment.
At the end of the last assignment, you had a working Lunar Lander game with a text-based interface. This is pretty cool, but also a little boring to play. Let's update it so that it uses a graphical interface.
First, change your LanderGame
's constructor so that it initializes its interface to a GraphicLanderInterface
. Once you've done that, you should be able to play the game using the bare-bones graphical interface.
There are a few problems with the current graphical interface, however: There's no way to set any thrust. Currently, any mouse click just inputs 0 for thrust amount. There is no display of lander information other than a shape drawn that shows a “lander” above a surface. When the lander lands, the program simply closes down in an unsatisfying way.
Fortunately, you are here to fix these problems! You will need to alter the GraphicLanderInterface
class.
show_info()
method is called, also display on the graphical window the lander's current status. Show Fuel, Velocity and Altitude.If you've done all that, you should have a playable grahpical lunar lander game.
This interface is still kind of lacking, though. So, for the bulk of the points on this assignment, really spruce it up. Add some of the following things:
To get full credit for the “additional features” part of this assignment, you need to add at least four of these things.
Now that you've modified some of the interface code, be sure to add your name to the top of interfaces.py!
Zip up your lander.py and modified interfaces.py into hw13.zip, and submit it via Moodle.
This assignment originally designed by Andy Exley. Thanks for sharing, Andy!