Rocket Landing Simulator

Gate Check #3 - Player Controls
Go Back to the Assignment Description

Part 1 (Overview) - Part 2 (Problem Description) - Part 3 (Rocket Controls) - Part 4 (Collision Check) - Part 5 (Metric Tracking) - Part 6 (Crash/Landing Detection)

Overview

In this gate check, you will implement player controls. Your code will allow the user to move the rocket by pressing the arrow keys. You will also implement a basic heads up display (HUD) in order to track basic performance stats (e.g., fuel consumed, time in flight, etc.). Finally, your code will detect when the rocket 1) hits the ground, 2) goes off the horizontal edges of the screen, or 3) lands on the boat. When this happens, the program will determine if the rocket crashed or landed, and reset the simulation for the next round.

Estimated Workload

Big Picture

# Initializes the Simulation At Least Once
initialize_simulation(True)                      

# Main "Game Loop"
while pythonGraph.window_not_closed():
    if is_simulation_over() == False:           # <-----   WE WILL BE MODIFYING THIS 
        erase_objects()                          
        draw_objects()                          # <-----   WE WILL BE MODIFYING THIS 
        get_input()                             # <-----   WE WILL BE MODIFYING THIS
        update_objects()                        # <-----   WE WILL BE MODIFYING THIS
    else:
        analyze_results()                       # <-----   WE WILL BE MODIFYING THIS
        initialize_simulation(False)              

Expected Outcome

When you have completed this gate check, you should have a fully playable rocket landing simulator.

Proceed to the next section.