fixed game loop FPSSync and state machine