Game gameOver method
Stay organized with collections
Save and categorize content based on your preferences.
gameOver(): void;
The user reached a game over event.
The SDK also uses game over events for competitions, ads, and other features.
You should call gameOver
for failure outcomes. For example, when the user dies
or was unable to complete a level, and when one of the following occurs:
- The user restarts.
- The user exits a level.
- The user clicks the home button to go back to the main menu.
- A similar event occurs that causes the session to end.
Requirements
- Your game must call this method for any failure outcomes.
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2024-09-03 UTC.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2024-09-03 UTC."],[[["The `gameOver()` method signals the end of a game session due to failure, such as player death or level incompletion."],["This method is essential for competitions, ads, and other SDK features, and should be called when the user restarts, exits a level, returns to the main menu, or encounters similar session-ending events."],["Games must call `gameOver()` for any failure outcomes to ensure proper functionality within the SDK."]]],[]]