Beispiel #1
0
def frame():
    # Events
    if events.is_key_down(ord('w')):
        graph.move_camera_forward(0.2)
    if events.is_key_down(ord('s')):
        graph.move_camera_back(0.2)
    if events.is_key_down(ord('a')):
        graph.move_camera_right(0.2)
    if events.is_key_down(ord('d')):
        graph.move_camera_left(0.2)
    if events.is_key_down(ord('t')):
        switch_mouse_lock()

    # Fps
    fps.draw()

    # Cursor
    cursor.draw()
Beispiel #2
0
def run():
    """ Launch the main loop """
    while is_running:
        # Time
        time.update()
        fps.update()
        # Events
        events.reset()
        events.manage()
        if events.is_window_closed() or events.is_key_down(ord('x')):
            stop()
        # Drawing
        graph.clear_buffers()
        graph.load_3D_matrix()
        graph.draw_blocks()
        graph.load_2D_matrix()
        frame()
        window.display()