NEW: Learning electronics? Ask your questions on the new Electronics Questions & Answers site hosted by CircuitLab.
Project Help and Ideas » Lunar Lander Game
February 08, 2010 by pfangrad |
Here is a NerdKit project based on the classic Lunar Lander game. The object of the game is to land on the moon gently (less than 5 ft/sec) so that you can live to go back to earth. This simple project uses the Nerdkit supplied LCD display, piezo buzzer, a push-button switch to control the rocket thruster, and a variable resistor to allow for variable thrust (this is optional if the Thrust value is hard coded in software - see line 135). The display is very basic but gives the user a little bit of appreciation for the difficulty that the first astronauts faced landing on the moon. This simulation is obviously very simplistic but it is still a real challenge to land with the finite amount of fuel available. When in descent mode, the LCD shows the following values: A; Altitude - you start off at 300ft V: Velocity - you start at 40 ft/sec but must slow to at least 5 ft/sec when you land T: Thruster - the amount of thrust your rocket will give. This is controlled by the variable resistor and gives a value of 1 to 30. The higher the thruster is set the quicker you use up your Fuel. F: Fuel - you start off with 100lbs Here is a simple schematic: Here is a picture of my setup: This link will provide the full source code and makefile. Happy Landings! |
---|---|
February 08, 2010 by Rick_S |
Cool, what a great project. It'd be neat to revive a bunch of old games... I may have to give this some thought. I'd love to see some old text based adventures. That would make for a fun project. Rick |
February 09, 2010 by mrobbins (NerdKits Staff) |
Hi Paul, Great project! Paul also sent me this YouTube video of the app in action. Also, for everyone else, I'd recommend looking through the code, as it's very cleanly written. For example, the "physics engine":
It's very clear with the two acceleration sources (gravity and rocket). And it's also neat how you change the rocket noise based on the current thrust level:
and generating the rocket noise based on a combination of a interrupt and a random number generator is really interesting. Mike |
February 11, 2010 by Phrank916 |
This is an AWESOME project, I am definitely going to be studying this code to glean all the new concepts that I can from it. Nice Work! Ted |
Please log in to post a reply.
Did you know that interrupts can be used to trigger pieces of code when events happen? Learn more...
|