本文整理匯總了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)