def update(self):
    'Update game state.'
    Menu.bg_offset += 2
    if (Menu.bg_offset > (0.85 * Constants.WINDOW_SIZE.x)):
        Menu.bg_dimness_current += Menu.bg_diminish_rate
        if (Menu.bg_dimness_current >= 255):
            Menu.current_bg = ((Menu.current_bg + 1) % len(Menu.backgrounds))
            Menu.bg_offset = Menu.bg_offset_at_start
            Menu.bg_dimness_current = 255
    elif (Menu.bg_dimness_current > Menu.bg_dimness_peak):
        Menu.bg_dimness_current -= Menu.bg_diminish_rate
Update game state.
def update(self):
    
    Menu.bg_offset += 2
    if (Menu.bg_offset > (0.85 * Constants.WINDOW_SIZE.x)):
        Menu.bg_dimness_current += Menu.bg_diminish_rate
        if (Menu.bg_dimness_current >= 255):
            Menu.current_bg = ((Menu.current_bg + 1) % len(Menu.backgrounds))
            Menu.bg_offset = Menu.bg_offset_at_start
            Menu.bg_dimness_current = 255
    elif (Menu.bg_dimness_current > Menu.bg_dimness_peak):
        Menu.bg_dimness_current -= Menu.bg_diminish_rate