# on_key_up(key)
键盘按键放开时调用,key
为当前按键。
from cpgzero import *
alien = Actor("alien")
def on_key_up(key):
if key == keys.A:
print("a")
elif key == keys.K_0:
print("0")
elif key == keys.ENTER:
print("enter")
键盘按键放开时调用,key
为当前按键。
from cpgzero import *
alien = Actor("alien")
def on_key_up(key):
if key == keys.A:
print("a")
elif key == keys.K_0:
print("0")
elif key == keys.ENTER:
print("enter")