Game interface
Stay organized with collections
Save and categorize content based on your preferences.
Game lifecycle events and pause controls.
Methods
gameOver(): void
The user reached a game over event. Required
firstFrameReady(): void
Announces that the first frame is ready to be shown. Required
levelComplete(level: number): void
The user reached a level complete event. Required
onPause(callback: () => void): void
Subscribes to pause events. Required
onResume(callback: () => void): void
Subscribes to resume events. Required
ready(): void
The game has finished loading and is ready to play. Required.
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 Game API provides essential lifecycle events like `gameOver`, `firstFrameReady`, `levelComplete`, and `ready` to manage the game flow."],["Developers can subscribe to pause and resume events using `onPause` and `onResume` methods, respectively, to control game states."],["All the listed methods are required for game integration, ensuring consistent functionality."]]],[]]