Gate Check #3 - Player Controls
Go Back to the Assignment Description
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.
# 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)
When you have completed this gate check, you should have a fully playable rocket landing simulator.