Game levelComplete method
Stay organized with collections
Save and categorize content based on your preferences.
levelComplete(
level: number
): void;
The user reached a level complete event.
levelComplete
is for games with levels. Your game should call levelComplete
when a level is successfully completed by the user. If levels are ordered
level
should be the index of the completed level, starting from 1. If levels
are unordered level
should be 0. If your game doesn't have levels or success
milestones, then you don't need to use this API.
Even if your game doesn't have discrete levels, you can still call this API if
your game has discrete ordered success milestones that are natural stopping
points. For example, the game
99 Balls 3D calls levelComplete
on every successful user fling.
Requirements
- If your game has levels, your game must call this method whenever
the user completes a level.
- If your game doesn't have discrete levels , your game should call
this method on any appropriate success milestones.
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."],[[["`levelComplete` is an event triggered when a user successfully completes a level or milestone in a game."],["For games with ordered levels, `level` represents the index of the completed level starting from 1, for unordered levels it should be 0, and for games without levels, this API isn't necessary."],["While primarily for level-based games, `levelComplete` can also be used to mark significant progress points or successes in games without traditional levels."],["Games with levels must call this method upon level completion, while games without distinct levels should call it at appropriate success milestones."]]],[]]