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


Python Game.keyboard_key_released方法代码示例

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


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

示例1: execute

# 需要导入模块: from myrmidon import Game [as 别名]
# 或者: from myrmidon.Game import keyboard_key_released [as 别名]
 def execute(self):
     self.media = Media()
     self.map = Map(self, os.path.join('maps', Consts.default_map_file))
     while True:
         if Game.keyboard_key_released(K_q):
             self.quit_game()
         yield
开发者ID:Fiona,项目名称:spacefarm,代码行数:9,代码来源:Window.py

示例2: execute

# 需要导入模块: from myrmidon import Game [as 别名]
# 或者: from myrmidon.Game import keyboard_key_released [as 别名]
 def execute(self, window, player_num):
     self.window = window
     self.player_num = player_num
     self.z = -10
     self.image = self.window.media.gfx['player']
     self.x = Game.screen_resolution[0] / 2 + self.start_offsets[self.player_num][0]
     self.y = Game.screen_resolution[1] / 2 + self.start_offsets[self.player_num][1]
     self.anim_time = 0
     self.alpha = 0.0
     self.colour = Player.colours[self.player_num]
     self.selected = False
     self.do_die = False
     while True:
         if not self.selected:
             for k,v in enumerate(self.window.input.joys[self.player_num].released_buttons):
                 if k == 7:
                     continue
                 if v or (player_num == 2 and Game.keyboard_key_released(K_SPACE)):
                     self.window.media.sfx['playerregister'].sound.play()
                     for frame, total in Game.timer_ticks(15):
                         self.alpha = Game.slerp(0.0, 0.95, frame / total)
                         self.anim()
                         yield
                     self.selected = True
                     self.window.selected_players.append(self.player_num)
         else:
             if self.do_die:
                 for frame, total in Game.timer_ticks(10):
                     self.alpha = Game.slerp(0.0, 0.95, frame / total)
                     self.anim()
                     yield
                 self.destroy()
         self.anim()
         yield
开发者ID:Fiona,项目名称:Diagonex,代码行数:36,代码来源:__main__.py

示例3: execute

# 需要导入模块: from myrmidon import Game [as 别名]
# 或者: from myrmidon.Game import keyboard_key_released [as 别名]
 def execute(self):
     self.images = {
         'blue_block' : Game.load_image("blue_block.png"),
         'red_block' : Game.load_image("red_block.png"),
         }
     self.blocks = [
         Block(self, 100, 100, 'red'),
         Block(self, 100, 300, 'blue')
         ]
     while True:
         if Game.keyboard_key_released(K_ESCAPE):
             sys.exit()
         yield
开发者ID:piratebunny,项目名称:patch,代码行数:15,代码来源:main.py


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