[Tutor] high score lists
R. Alan Monroe
amonroe at columbus.rr.com
Fri Apr 15 00:11:48 CEST 2005
> Anyone have some good beginning ideas/references to creating a high
> score list and storing scores in a simple python game? (if there's
> something in the pygames module, or a simpler python way). I'm
> mod'ing a space invaders-type game and would like to add a high score
> list :)
Quick and dirty approach: make a list of tuples
[ (40000, 'John Doe'),
(30000, 'Steve Austin') ]
You can append new ones to the end of the list, sort it, reverse it,
etc.
Alan
More information about the Tutor
mailing list