Achievements
Achievements in HTML5 games are an exciting and rewarding feature that adds an extra layer of engagement for players. They serve as milestones, celebrating a player's progress, skill, and dedication.
Last updated
Achievements in HTML5 games are an exciting and rewarding feature that adds an extra layer of engagement for players. They serve as milestones, celebrating a player's progress, skill, and dedication.
Last updated
Support
Use this to determine if you can implement achievements for your game on the current platform.
Check if getting list of achievements is supported.
Check if built-in popup is supported.
Unlocks achievement for a player.
{"is-c3-clipboard-data":true,"type":"events","items":[{"eventType":"block","conditions":[{"id":"on-clicked","objectClass":"Button"}],"actions":[],"children":[{"eventType":"block","conditions":[{"id":"compare-two-values","objectClass":"System","parameters":{"first-value":"PlaygamaBridge.PlatformId","comparison":0,"second-value":"\"y8\""}}],"actions":[{"id":"add-action-parameter","objectClass":"PlaygamaBridge","parameters":{"key":"\"achievementkey\"","value":"\"YOUR_ACHIEVEMENT_KEY\""}},{"id":"add-action-parameter","objectClass":"PlaygamaBridge","parameters":{"key":"\"achievement\"","value":"\"YOUR_ACHIEVEMENT_NAME\""}}]},{"eventType":"block","conditions":[{"id":"compare-two-values","objectClass":"System","parameters":{"first-value":"PlaygamaBridge.PlatformId","comparison":0,"second-value":"\"lagged\""}}],"actions":[{"id":"add-action-parameter","objectClass":"PlaygamaBridge","parameters":{"key":"\"achievement\"","value":"\"YOUR_ACHIEVEMENT_ID\""}}]},{"eventType":"block","conditions":[],"actions":[{"id":"achievements-unlock","objectClass":"PlaygamaBridge"}]}]},{"eventType":"block","conditions":[{"id":"on-achievements-unlock-completed","objectClass":"PlaygamaBridge"}],"actions":[{"type":"comment","text":"success"}]}]}
Get List
Returns the achievement list in JSON
{"is-c3-clipboard-data":true,"type":"events","items":[{"eventType":"block","conditions":[{"id":"on-clicked","objectClass":"Button"}],"actions":[{"id":"achievements-get-list","objectClass":"PlaygamaBridge"}]},{"eventType":"block","conditions":[{"id":"on-achievements-get-list-completed","objectClass":"PlaygamaBridge"}],"actions":[],"children":[{"eventType":"block","conditions":[{"id":"compare-two-values","objectClass":"System","parameters":{"first-value":"PlaygamaBridge.AchievementsCount","comparison":4,"second-value":"0"}}],"actions":[],"children":[{"eventType":"block","conditions":[{"id":"for","objectClass":"System","parameters":{"name":"\"items\"","start-index":"0","end-index":"PlaygamaBridge.AchievementsCount - 1"}}],"actions":[],"children":[{"eventType":"block","conditions":[{"id":"compare-two-values","objectClass":"System","parameters":{"first-value":"PlaygamaBridge.PlatformId","comparison":0,"second-value":"\"y8\""}}],"actions":[{"id":"log","objectClass":"Browser","parameters":{"type":"log","message":"\"Achievement ID: \" & PlaygamaBridge.AchievementPropertyValue(loopindex(\"items\"), \"achievementid\")"}},{"id":"log","objectClass":"Browser","parameters":{"type":"log","message":"\"Achievement Name: \" & PlaygamaBridge.AchievementPropertyValue(loopindex(\"items\"), \"achievement\")"}},{"id":"log","objectClass":"Browser","parameters":{"type":"log","message":"\"Achievement Key: \" & PlaygamaBridge.AchievementPropertyValue(loopindex(\"items\"), \"achievementkey\")"}},{"id":"log","objectClass":"Browser","parameters":{"type":"log","message":"\"Description: \" & PlaygamaBridge.AchievementPropertyValue(loopindex(\"items\"), \"description\")"}},{"id":"log","objectClass":"Browser","parameters":{"type":"log","message":"\"Icon: \" & PlaygamaBridge.AchievementPropertyValue(loopindex(\"items\"), \"icon\")"}},{"id":"log","objectClass":"Browser","parameters":{"type":"log","message":"\"Difficulty: \" & PlaygamaBridge.AchievementPropertyValue(loopindex(\"items\"), \"difficulty\")"}},{"id":"log","objectClass":"Browser","parameters":{"type":"log","message":"\"Secret: \" & PlaygamaBridge.AchievementPropertyValue(loopindex(\"items\"), \"secret\")"}},{"id":"log","objectClass":"Browser","parameters":{"type":"log","message":"\"Awarded: \" & PlaygamaBridge.AchievementPropertyValue(loopindex(\"items\"), \"awarded\")"}},{"id":"log","objectClass":"Browser","parameters":{"type":"log","message":"\"Game: \" & PlaygamaBridge.AchievementPropertyValue(loopindex(\"items\"), \"game\")"}},{"id":"log","objectClass":"Browser","parameters":{"type":"log","message":"\"Link: \" & PlaygamaBridge.AchievementPropertyValue(loopindex(\"items\"), \"link\")"}},{"id":"log","objectClass":"Browser","parameters":{"type":"log","message":"\"Player ID: \" & PlaygamaBridge.AchievementPropertyValue(loopindex(\"items\"), \"playerid\")"}},{"id":"log","objectClass":"Browser","parameters":{"type":"log","message":"\"Player Name: \" & PlaygamaBridge.AchievementPropertyValue(loopindex(\"items\"), \"playername\")"}},{"id":"log","objectClass":"Browser","parameters":{"type":"log","message":"\"Last Updated: \" & PlaygamaBridge.AchievementPropertyValue(loopindex(\"items\"), \"lastupdated\")"}},{"id":"log","objectClass":"Browser","parameters":{"type":"log","message":"\"Date: \" & PlaygamaBridge.AchievementPropertyValue(loopindex(\"items\"), \"date\")"}},{"id":"log","objectClass":"Browser","parameters":{"type":"log","message":"\"Relative Date: \" & PlaygamaBridge.AchievementPropertyValue(loopindex(\"items\"), \"rdate\")"}}]}]}]}]}]}
Show Native Popup
Some platforms support built-in achievement list which is shown in overlay
{"is-c3-clipboard-data":true,"type":"events","items":[{"eventType":"block","conditions":[{"id":"on-clicked","objectClass":"Button"}],"actions":[{"id":"achievements-show-native-popup","objectClass":"PlaygamaBridge"}]},{"eventType":"block","conditions":[{"id":"on-achievements-show-native-popup-completed","objectClass":"PlaygamaBridge"}],"actions":[{"type":"comment","text":"success"}]}]}