This is called when the application is being backgrounded (e.g., due to switching to another app or closing it via the home button) The game should release shared resources, save state, etc..., since it can be terminated from the background state without any further warning.