当前位置: 首页>>代码示例>>Python>>正文


Python Game.load_audio方法代码示例

本文整理汇总了Python中myrmidon.Game.load_audio方法的典型用法代码示例。如果您正苦于以下问题:Python Game.load_audio方法的具体用法?Python Game.load_audio怎么用?Python Game.load_audio使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在myrmidon.Game的用法示例。


在下文中一共展示了Game.load_audio方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: __init__

# 需要导入模块: from myrmidon import Game [as 别名]
# 或者: from myrmidon.Game import load_audio [as 别名]
 def __init__(self):
     self.gfx['player'] = Game.load_image(os.path.join("gfx", "player.png"), sequence = True, width = 64, height = 64)
     self.gfx['grid'] = Game.load_image(os.path.join("gfx", "grid.png"), sequence = True, width = 96, height = 96)
     self.gfx['health'] = Game.load_image(os.path.join("gfx", "health.png"), sequence = True, width = 19, height = 18)
     self.gfx['medium_particle'] = Game.load_image(os.path.join("gfx", "medium_particle.png"))
     self.gfx['footstep1'] = Game.load_image(os.path.join("gfx", "footstep1.png"))
     self.gfx['footstep2'] = Game.load_image(os.path.join("gfx", "footstep2.png"))
     self.gfx['bump_particle'] = Game.load_image(os.path.join("gfx", "bump_particle.png"))
     self.gfx['shot'] = Game.load_image(os.path.join("gfx", "shot.png"))
     self.gfx['player_chunk'] = Game.load_image(os.path.join("gfx", "player_chunk.png"))
     self.gfx['background'] = Game.load_image(os.path.join("gfx", "background.png"))
     self.gfx['spawn_particle'] = Game.load_image(os.path.join("gfx", "spawn_particle.png"))
     self.gfx['shot_particle'] = Game.load_image(os.path.join("gfx", "shot_particle.png"))
     self.gfx['death_particle'] = Game.load_image(os.path.join("gfx", "death_particle.png"))
     self.fnt['fps'] = Game.load_font(os.path.join("fnt", "nulshock.ttf"), size = 40)
     self.fnt['timer'] = Game.load_font(os.path.join("fnt", "nulshock.ttf"), size = 40)
     self.fnt['final_score'] = Game.load_font(os.path.join("fnt", "nulshock.ttf"), size = 60)
     self.fnt['score_press_start'] = Game.load_font(os.path.join("fnt", "squared.ttf"), size = 40)
     self.fnt['title_name'] = Game.load_font(os.path.join("fnt", "squared.ttf"), size = 110)
     self.fnt['title_press_start'] = Game.load_font(os.path.join("fnt", "squared.ttf"), size = 40)
     self.fnt['player_select_press_buttons'] = Game.load_font(os.path.join("fnt", "squared.ttf"), size = 40)
     self.mus['title'] = Game.load_audio(os.path.join("music", "title.ogg"))
     self.mus['level'] = Game.load_audio(os.path.join("music", "level.ogg"))
     self.sfx['pressstart'] = Game.load_audio(os.path.join("sfx", "pressstart.wav"))
     self.sfx['playerregister'] = Game.load_audio(os.path.join("sfx", "playerregister.wav"))
     self.sfx['respawn'] = Game.load_audio(os.path.join("sfx", "respawn.wav"))
     self.sfx['bounce'] = Game.load_audio(os.path.join("sfx", "bounce.wav"))
     self.sfx['shoot'] = Game.load_audio(os.path.join("sfx", "shoot.wav"))
     self.sfx['death'] = Game.load_audio(os.path.join("sfx", "death.wav"))
     self.sfx['buildlevel'] = Game.load_audio(os.path.join("sfx", "buildlevel.wav"))
     self.sfx['timewarning'] = Game.load_audio(os.path.join("sfx", "timewarning.wav"))
     self.sfx['hurt'] = []
     for i in range(1,8):
         self.sfx['hurt'].append(Game.load_audio(os.path.join("sfx", "hurt" + str(i) + ".wav")))
开发者ID:Fiona,项目名称:Diagonex,代码行数:36,代码来源:media.py


注:本文中的myrmidon.Game.load_audio方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。