test stats anche achievements
This commit is contained in:
@@ -1,25 +1,26 @@
|
||||
extends Node
|
||||
|
||||
#Achievement e statistiche devono essere pubblicati live nel backend
|
||||
#Steamworks anche se il gioco non è ancora uscito altrimenti le chiamate ritornano errore
|
||||
#Achievements and stats must be published on Steam even if game is not yet released
|
||||
#if you have an error setting achievements or stats in debug mode remember to open your steam client
|
||||
#with jmp games account or another account who bought this game. If error persist try to clos and reopen steam client.
|
||||
const KNOWN := [
|
||||
"ACH_FIRST_WIN",
|
||||
"ACH_PLAY_10_GAMES",
|
||||
"ACH_REACH_LEVEL_5",
|
||||
"ACH_DISTANCE_100",
|
||||
"ACH_DISTANCE_200",
|
||||
"ACH_10_PHOTOS",
|
||||
]
|
||||
|
||||
#how it works:
|
||||
#func _on_player_won() -> void:
|
||||
# Achievements.unlock("ACH_FIRST_WIN") #unlock the achievement at first win
|
||||
# Achievements.unlock("ACH_DISTANCE_100") #unlock the achievement at first win
|
||||
|
||||
#func _on_match_finished(coins_collected: int) -> void:
|
||||
#update stats
|
||||
#...
|
||||
#check thresholds and unlock achievements
|
||||
# if Stats.get_int("stat_games_played") >= 10:
|
||||
# Achievements.unlock("ACH_PLAY_10_GAMES")
|
||||
# if Stats.get_int("stat_total_coins") >= 100:
|
||||
# Achievements.unlock("ACH_COLLECT_100_COINS")
|
||||
# if Stats.get_int("stat_distance_km") >= 100:
|
||||
# Achievements.unlock("ACH_DISTANCE_100")
|
||||
# if Stats.get_int("stat_distance_km") >= 200:
|
||||
# Achievements.unlock("ACH_DISTANCE_200")
|
||||
|
||||
signal unlocked(api_name: String)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user