def on_key_release(self, key, modifiers):
"""This function is called when a key is released.
'key' is a constant indicating which key was pressed.
'modifiers' is a bitwise or of several constants indicating which
modifiers are active at the time of the press (ctrl, shift, capslock, etc.)
Constants are the ones from pyglet.window.key
"""
char = pyglet.window.key.symbol_string(key)
if char in self.keys_pressed:
self.keys_pressed.remove(char)
mech = self.battle.getTurnUnit()
if char == "P":
mech.sprite.resume()
评论列表
文章目录