本文整理汇总了Python中Img.musplay方法的典型用法代码示例。如果您正苦于以下问题:Python Img.musplay方法的具体用法?Python Img.musplay怎么用?Python Img.musplay使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Img
的用法示例。
在下文中一共展示了Img.musplay方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: not
# 需要导入模块: import Img [as 别名]
# 或者: from Img import musplay [as 别名]
elif event.type==pygame.KEYDOWN:
menus=Tiles.tilemenus+Tiles.objmenus
menu=menus[selmenu]
if event.key==pygame.K_w:
selobjs[selmenu]=(selobjs[selmenu]-1)%len(menu)
elif event.key==pygame.K_s:
selobjs[selmenu]=(selobjs[selmenu]+1)%len(menu)
elif event.key==pygame.K_a:
selmenu=(selmenu-1)%len(menus)
elif event.key==pygame.K_d:
selmenu=(selmenu+1)%len(menus)
elif event.key==pygame.K_t:
screen = pygame.display.set_mode((640, 672))
w.save()
wo=World.World(False,"sav")
Img.musplay("Cumulo.ogg")
while not (wo.playerdead or wo.done):
events = pygame.event.get()
for event in events:
if event.type == pygame.QUIT:
sys.exit()
screen.fill((125, 255, 255))
wo.update(events)
wo.render(screen)
pygame.draw.rect(screen,(200,200,200),pygame.Rect(0,640,640,32))
ap=wo.get_activeplayer()
screen.blit(ap.iconv[(0,1)],(0,640))
for n in range(ap.rng):
screen.blit(pexpimg if ap.pen else expimg, (32+n*32,640))
for x in range(ap.bombs):
screen.blit(bombimg,(64+n*32+x*32,640))
示例2: range
# 需要导入模块: import Img [as 别名]
# 或者: from Img import musplay [as 别名]
import BattleWorld, Img
from random import choice
import Controllers
pdf = pygame.font.get_default_font()
tfont=pygame.font.Font(pdf,60)
sfont=pygame.font.Font(pdf,20)
clock = pygame.time.Clock()
expimg=Img.img2("Exp")
pexpimg=Img.img2("ExpPen")
bombimg=Img.img2("Bomb")
tickimg=Img.img2("Tick")
crossimg=Img.img2("Null")
pimgs=[Img.img2("men/"+x) for x in ["Man2","FMan","SMan","Tman"]]#+[Img.imgstrip("men/CMan")[0]]
breaking = False
Img.musplay("ChOrDs.ogg")
while not breaking:
for event in pygame.event.get():
if event.type == pygame.QUIT:
sys.exit()
elif event.type == pygame.MOUSEBUTTONDOWN:
breaking = True
screen.fill((255, 0, 0))
Img.bcentre(tfont,"BOMB BATTLES",screen)
Img.bcentre(sfont,"Click to start",screen,50)
pygame.display.flip()
clock.tick(60)
breaking=False
controllers=[Controllers.Keyboard1(),Controllers.Keyboard2()]+[Controllers.UniJoyController(n) for n in range(pygame.joystick.get_count())]
activecons=[]
acps=[]