好吧,我在课堂上和事件中有这两个功能(自我)我想让它在发生某些事情时播放一些声音,在这种情况下,如果有人输了或输了。
问题是我要删除" olafo"当发生这种情况时,在播放声音之前它会首先播放声音,然后删除" olafo"
此外,如果有一种方法可以同时做到两者更好
def evento(self):
for i in self.coorRed:
redcros = self.canvas1.find_overlapping(i[0], i[1], i[2], i[3])
if self.olafo in redcros: #WIN
self.canvas1.delete(self.olafo)
sound = "Versus Win New Super Mario Bros"
self.beep(sound)
for i in self.coorYellow:
yelcros = self.canvas1.find_overlapping(i[0], i[1], i[2], i[3])
if self.olafo in yelcros:#LOSE
self.canvas1.delete(self.olafo)
sound = "Lose Life New Super Mario Bros"
self.beep(sound)
for i in self.coorRest:
rescros = self.canvas1.find_overlapping(i[0], i[1], i[2], i[3])
if self.olafo in rescros:
pass
顺便说一下,如果重要或问题是我使用winsound,我需要使用内置的库?