You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
18 lines
401 B
18 lines
401 B
import pygame
|
|
|
|
def init():
|
|
pygame.init()
|
|
win = pygame.display.set_mode((400, 400))
|
|
|
|
def getKey(keyName):
|
|
ans = False
|
|
for eve in pygame.event.get(): pass
|
|
keyInput = pygame.key.get_pressed()
|
|
myKey = getattr(pygame,'K_{}'.format(keyName))
|
|
if keyInput[myKey]:
|
|
ans = True
|
|
pygame.display.update()
|
|
return ans
|
|
|
|
if __name__ == '__main__':
|
|
init() |