def getplayername(self):
"""Ask the player his name, to go on the high-score list."""
if NO_WX: return USER_NAME
try:
import wx
except:
print "Pacman Error: No module wx. Can not ask the user his name!"
print " :( Download wx from http://www.wxpython.org/"
print " :( To avoid seeing this error again, set NO_WX in file pacman.pyw."
return USER_NAME
app=wx.App(None)
dlog=wx.TextEntryDialog(None,"You made the high-score list! Name:")
dlog.ShowModal()
name=dlog.GetValue()
dlog.Destroy()
app.Destroy()
return name
评论列表
文章目录