Relevant code is located in the C# scripts under /Assets/Scripts/.
This is a modern Unity 3D recreation of the classic 1979 Atari game, Lunar Lander:
https://www.youtube.com/watch?v=McAhSoAEbhM
The goal of this game is safely land a lunar space craft on designated spots on the moon for points. The player must carefully balance the physics of the lander by rotating it left/right and applying a constant thrust force when needed, while also managing fuel consumption. If the lander collides with the moon's surface at an incorrect angle and/or high velocity, it will crash.
The lander is a multi-part model, held together by Fixed Joints, which breaks a apart upon crashing.
For each game, the moon's surface mesh and landing platforms are randomly generated.
The camera will zoom in and focus on the lander when it lands or crashes.
The player can keep landing on platforms until their fuel runs out. Each time they land a platform successfully, the lander is placed back into the sky and the stage is regenerated.
Click on the UI buttons to activate them. Control the lunar lander using the up, left, and right arrows. ARROW UP = add force in the lander's forward directon ARROW LEFT/RIGHT = add torque to the lander
Note: both types of lander movement consume fuel
The lander will crash instantly if any part of it other than its feet touch the moon's surface. The lander will also crash if it's feet touch the surface AND:
- It is leaning more than 10 degrees to either the left or right.
- It's landing speed is greater than a specific threshold.
- It has ran out of fuel and lands on a part of the surface that has no platform.
Each platform is represented by a flat purple/white particle line on the moon's surface. 3 or 4 are randomly placed with the generated moon surface. The points associated with each platform are based on their width. A smaller width = less points.
The player will be awarded the points associated with a platform if:
- The lander lands on a platform without crashing and
- remains completetly upright (leaning less than 1 degree left or right) for 2 continous seconds
note: The player can till be awarded points even after their fuel runs out, if they are lucky enough to have the lander fall on a platform successfully. If this happens, they will get the points but the game will end (since they have no more fuel).
Screenshots: