Add files via upload

This commit is contained in:
themixray 2021-12-09 23:12:27 +03:00 committed by GitHub
parent b7ba6aec4c
commit 5b9eeb258f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -30,18 +30,20 @@ while run:
win.blit(score,(0,0))
set_position = win.position
if pygwin.keyboard.isPressed('w'):
player[1] -= 5
win.move(win.position[0],win.position[1]-5) # Move window up
set_position[1] -= 5 # Move window up
if pygwin.keyboard.isPressed('s'):
player[1] += 5
win.move(win.position[0],win.position[1]+5) # Move window down
set_position[1] += 5 # Move window down
if pygwin.keyboard.isPressed('d'):
player[0] += 5
win.move(win.position[0]+5,win.position[1]) # Move window right
set_position[0] += 5 # Move window right
if pygwin.keyboard.isPressed('a'):
player[0] -= 5
win.move(win.position[0]-5,win.position[1]) # Move window left
set_position[0] -= 5 # Move window left
win.move(*set_position) # Set position
if playerRect.collide(apple):
apple = pygwin.rect(random.randint(50,490),