本文整理汇总了Python中terrain.Terrain.playSound方法的典型用法代码示例。如果您正苦于以下问题:Python Terrain.playSound方法的具体用法?Python Terrain.playSound怎么用?Python Terrain.playSound使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类terrain.Terrain
的用法示例。
在下文中一共展示了Terrain.playSound方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: nextLevel
# 需要导入模块: from terrain import Terrain [as 别名]
# 或者: from terrain.Terrain import playSound [as 别名]
def nextLevel(self):
# Update and save progress
saved = self.progress[self.level]
if saved["score"] == None or self.score > saved["score"]:
saved["score"] = self.score
duration = self.stopwatch.getSeconds()
if saved["time"] == None or duration < saved["time"]:
saved["time"] = duration
self.progress.save()
# Load next level
Terrain.playSound("happy")
index = self.maps.levels.index(self.level) + 1
if index >= len(self.maps.levels):
self.mode = "win"
else:
self.level = self.maps.levels[index]
self.loadLevel()
示例2: killBall
# 需要导入模块: from terrain import Terrain [as 别名]
# 或者: from terrain.Terrain import playSound [as 别名]
def killBall(self):
Terrain.playSound("sad")
self.loadLevel()