R. Alan Monroe wrote:
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.
And you can use the pickle module to save and restore the list.
Kent
_______________________________________________
Tutor maillist - Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor