I want to create a ranking of players according to their points.
The one who has the most points on top of the ranking.
I use then the sort list initialization.
But it doesn't work at all.
Can you tell me what I am doing wrong in my code?
Code: Select all
init python:
class SortList(Action):
def __init__(self, ranking):
self.list = ranking
def __call__(self):
self.list.sort()
return True
screen ranking():
add "computer"
vbox xalign 0.99 yalign 0.01:
spacing 20
imagebutton auto "icon/buttonclose_%s.png" action Hide("ranking")
text "Mendoza [mendopoint]pts" align (0.60, 0.40)
text "Sinero [sinepoint]" align (0.30, 0.08)
text "Gibbs [gibpoint]" align (0.30, 0.12)
text "Alonzo [alonpoint]" align (0.30, 0.16)
text "Gonçalva [goncapoint]" align (0.30, 0.20)
text "Garrido [garripoint]" align (0.30, 0.24)
text "Enciso [encipoint]" align (0.30, 0.28)
text "Saima Lozano [lozapoint]" align (0.30, 0.32)