не появляется объект камень в моей игре очень прошу помочь
Python:
import pygame
import time
pygame.init()
display_width = 800
display_height = 600
display = pygame.display.set_mode((display_width, display_height))
pygame.display.set_caption("RUN!")
icon = pygame.image.load('icon.png')
pygame.display.set_icon(icon)
usr_width = 60
usr_height = 100
usr_x = display_width // 3
usr_y = display_height - usr_height - 100
rock_w = 20
rock_h = 70
rock_x = display_width - 50
rock_y = display_height - rock_h - 100
clock = pygame.time.Clock()
make_jump = False
jump_counter = 30
def gamerun():
game = True
global make_jump
while game:
for event in pygame.event.get():
if event.type == pygame.QUIT:
pygame.quit()
quit()
keys = pygame.key.get_pressed()
if keys[pygame.K_SPACE]:
make_jump = True
if make_jump:
jump()
time.sleep(0.01)
display.fill((255, 255, 255))
pygame.draw.rect(display, (41, 34, 61), (usr_x, usr_y, usr_width, usr_height))
pygame.display.update()
display.fill((255, 255, 255))
rock_draw()
pygame.draw.rect(display, (41, 34, 61), (usr_x, usr_y, usr_width, usr_height))
pygame.display.update()
clock.tick(60)
def jump():
global usr_y, jump_counter, make_jump
if jump_counter >= -30:
usr_y -= jump_counter / 2
jump_counter -= 1
else:
jump_counter = 30
make_jump = False
def rock_draw():
global rock_x, rock_y, rock_w, rock_h
if rock_x >= -rock_w:
pygame.draw.rect(display, (99, 108, 115), (rock_x, rock_y, rock_w, rock_h))
rock_x -= 4
else:
rock_x = display_width - 50
gamerun()