def ticks_to_millis(ticks):
    return (1000 * ticks) / float(options.fps())
def millis_to_ticks(millis):
    return (millis * options.fps()) / float(1000)
Exemplo n.º 3
0
gamestate_manager.set_state(GameStateManager.PLAYING_STATE, playing)
gamestate_manager.set_state(GameStateManager.EDITING_STATE, editing)
gamestate_manager.set_state(GameStateManager.MAIN_MENU_STATE, main_menu)
gamestate_manager.set_state(GameStateManager.SELECT_SINGLE_LEVEL_STATE, single_level)


gamestate_manager.set_current_state(GameStateManager.MAIN_MENU_STATE)

size = options.standard_size()
if settings.dev_mode():
    size = options.dev_size()
screen = pygame.display.set_mode(size)

still_running = True
clock = pygame.time.Clock()
FPS = options.fps()

actor = playing.get_player()  # The player's character

def stop_running(): 
    global still_running
    still_running = False
def take_screenshot():
    utilities.take_screenshot(screen)

GLOBAL_COMMANDS = {
    TAKE_SCREENSHOT: lambda: take_screenshot()
}

#ticks = 0
#display_freq = 60