def is_simulation_over(): return False # -------------------------------------------------------------- # Analyzes the Results of the Simulation # -------------------------------------------------------------- def analyze_results(): pass # ----------------------------------------------------- # "Main Program" # ----------------------------------------------------- pythonGraph.open_window(WINDOW_WIDTH, WINDOW_HEIGHT) pythonGraph.set_window_title( "CS110Z (S20) Rocket Simulator - YOUR NAME GOES HERE") # Initializes the Simulation At Least Once initialize_simulation(True) # Main "Game Loop" while pythonGraph.window_not_closed(): if is_simulation_over() == False: erase_objects() draw_objects() get_input() update_objects() else: analyze_results() initialize_simulation(False)
# Gets the number of balls from the user ball_x = 400 ball_y = 400 ball_x_velocity = 8 ball_y_velocity = -5 # Gets the Number of Times frame_count = 0 # Animation Flag animate = False # Setup tasks for window pythonGraph.open_window(SCREEN_WIDTH, SCREEN_HEIGHT) pythonGraph.set_window_title(SCREEN_TITLE) # Animation Loop while pythonGraph.window_not_closed(): pythonGraph.clear_window(pythonGraph.colors.WHITE) # Draws Some Text pythonGraph.draw_text("# of Times Drawn: " + str(frame_count), 0, 0, pythonGraph.colors.BLACK) # Draws the Circle pythonGraph.draw_circle(ball_x, ball_y, 35, pythonGraph.colors.RED, True) # Toggles Animation Mode if pythonGraph.key_pressed('space'): animate = not animate
def config(): # setup pythonGraph.open_window(700, 700) pythonGraph.clear_window(pythonGraph.colors.BLACK) pythonGraph.set_window_title('PythonGraph Draw')
WINDOW_HEIGHT * 2 / 3 - 50, "WHITE", 100) pythonGraph.draw_text("SCORE: " + str(round(score, 2)), WINDOW_WIDTH / 3, WINDOW_HEIGHT * 2 / 3 + 100, "WHITE", 100) pythonGraph.update_window() time.sleep(8.5) score = 0 time_elapsed = 0 rocket_y = rocket_height # ----------------------------------------------------- # "Main Program" # ----------------------------------------------------- pythonGraph.open_window(WINDOW_WIDTH, WINDOW_HEIGHT) pythonGraph.set_window_title("CS110Z (S20) Rocket Simulator - Zachary Benson") # -------------------------------------------------------------- # # Initializes the Simulation At Least Once initialize_simulation(True) # Main "Game Loop" while pythonGraph.window_not_closed(): if is_simulation_over() == False: erase_objects() draw_objects() get_input() update_objects() else: analyze_results()