本文整理汇总了Python中Img.musply方法的典型用法代码示例。如果您正苦于以下问题:Python Img.musply方法的具体用法?Python Img.musply怎么用?Python Img.musply使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Img
的用法示例。
在下文中一共展示了Img.musply方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: update
# 需要导入模块: import Img [as 别名]
# 或者: from Img import musply [as 别名]
def update(self, events):
"""Update Everything"""
if not pygame.mixer.music.get_busy():
Img.musply(choice(self.music), 1)
for n in range(self.tran[0]):
if not randint(0, self.tran[1]):
rx = randint(0, self.size[0] - 1)
ry = randint(0, self.size[1] - 1)
terrlist[self.terr[rx][ry]].ranupdate(self, rx, ry)
for ent in self.ents:
ent.update(self, events)
ent.mupdate(self, events)
self.anitick += 1
if self.anitick == 56:
self.anitick = 0
self.map = self.make_map()
for row in self.objs:
for obj in row:
if obj and obj.updatable:
obj.update(self)
if self.player.psupply > 0:
for pst in self.player.pstorage:
self.player.psupply -= pst.give_power(self, self.player.psupply)
if self.player.psupply == 0:
break
示例2:
# 需要导入模块: import Img [as 别名]
# 或者: from Img import musply [as 别名]
# image modules
import World
import Generators
import Img
import GUI
import Tutorial
pygame.display.set_icon(Img.imgret2("Monolith.png"))
pygame.display.set_caption("monolith")
numplayers = 1
wgen = 0
pset = 0
puzzles = 0
pnum = 0
c = pygame.time.Clock()
Img.musply("Planets/1. Mars.ogg")
nland = Img.imgret("NiceLand.png")
rgb = [200, 255, 255]
tick = 0
cont = True
kp = True
# titlescreen
srect = pygame.Rect(0, 0, 0, 0)
prect = pygame.Rect(0, 0, 0, 0)
grects = []
wsizemod = 0
wsrects = []
psrects = []
godmode = False
tutorial = False
tutb = pygame.Rect(0, 0, 0, 0)