Add files via upload

This commit is contained in:
themixray 2021-12-13 21:52:18 +03:00 committed by GitHub
parent d6915bc901
commit 741ea4081f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 29 additions and 18 deletions

View file

@ -15,10 +15,6 @@ while run: # Creating loop
run = False # Break loop
win.fill((255,255,255)) # Fill window with color
playerRect = pygwin.rect(player[0]-10,player[1]-10,20,20) # Player rect
win.draw.rect((0,0,0),playerRect) # Drawing player rect
win.draw.rect((200,50,50),apple) # Drawing apple rect
win.blit(score,(0,0)) # Writing player score
if pygwin.keyboard.isPressed('w'): # If keyboard key w pressed
@ -39,6 +35,10 @@ while run: # Creating loop
if player[1] > 510: # If player out of the screen (down)
player[1] = -10 # Set player position in up
playerRect = pygwin.rect(player[0]-10,player[1]-10,20,20) # Player rect
win.draw.rect((0,0,0),playerRect) # Drawing player rect
win.draw.rect((200,50,50),apple) # Drawing apple rect
if playerRect.collide(apple): # If player rect collide apple rect
apple = pygwin.rect(random.randint(0,490),
random.randint(0,490),20,20) # Change apple rect