本文整理汇总了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
示例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
示例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