-
Notifications
You must be signed in to change notification settings - Fork 184
Adding New Achievements
Jummit edited this page Apr 14, 2022
·
4 revisions
If you just want to add an achievement of a type that is already there, for example "collect a number of coins", create a new resource in the res://achievements/global
or res://achievements/level/LEVEL_NUMBER
folder.
Make sure to add the description to the localization file.
To create a new type of achievement, add a new script that extends the Achievement
class:
extends Achievement
class_name PressStartAchievement
export(int) var keyToPress
Then add the logic to check if the achievement is met in AchievementGet.gd
:
func check_achievements():
...
match achievement.get_script():
CoinsAchievement:
is_completed = coinsSinceStartingLevel >= achievement.coinsRequired
...
PressStartAchievement:
is_completed = Input.is_action_pressed(achievement.keyToPress)
Now you can create new resources with this type as described in "Using Existing Achievement Types"