###LevelData.py###
def save_score():
global score
path = bge.logic.expandPath(‘//’)
with open(path + ‘Endscore.txt’, ‘w’) as save:
save.write(str(score))
###Startscreen.py###
def display_endscore(cont):
own = cont.owner
path = bge.logic.expandPath(‘//’)
with open(path + ‘Endscore.txt’, ‘r’) as read:
endscore = read.read()
own[‘Text’] = endscore
Voir sur youtube