本文整理匯總了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=[]