Merge branch 'develop' of https://bdgit.educoder.net/pbyhqr72x/exercise_2 into lixiang
commit
5b16e41233
Binary file not shown.
Binary file not shown.
@ -0,0 +1,18 @@
|
|||||||
|
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()
|
After Width: | Height: | Size: 187 KiB |
After Width: | Height: | Size: 12 KiB |
After Width: | Height: | Size: 66 KiB |
File diff suppressed because it is too large
Load Diff
Loading…
Reference in new issue