Python:
import pygame
pygame.init()
win = pygame.display.set_mode((500,200))
pygame.display.set_caption(" игра")
x = 1
y = 1
#высота
higt = 30
#ширина
tall = 60
#скрость
spedd = 4
sjump = False
jump = 7
animka= True
anim = 0
her = True
retime = pygame.time.Clock()
run = pygame.image.load("8/run-1.1.png"), pygame.image.load("8/run-1.2.png"), pygame.image.load("8/run-1.3.png"), pygame.image.load("8/run-1.4.png"), pygame.image.load("8/run-1.5.png"), pygame.image.load("8/run-1.6.png")
runnot =pygame.image.load("8/Аним-1-1.png")
bq = pygame.image.load("123.jpg")
def rdr():
global anim
win.blit(bq, (0, 0))
if anim + 1 >= 30:
anim = 0
if run:
win.blit(run[anim // 5], (x, y))
else:
win.blit(runnot, (x, y))
pygame.display.update()
while her:
retime.tick(30)
for i in pygame.event.get():
if i.type == pygame.QUIT:
run = False
keys = pygame.key.get_pressed()
if keys[pygame.K_a] and x > 5:
x-=spedd
animka = True
elif keys[pygame.K_d] and x < 450:
x+=spedd
animka = True
else:
animka = False
anim = 0
if not(sjump):
if keys[pygame.K_w] and y > 5:
y-=spedd
if keys[pygame.K_s] and y < 150:
y+=spedd
if keys[pygame.K_SPACE]:
sjump = True
else:
if jump >= -7:
if jump < 0:
y+= (jump ** 2) / 2
else:
y-= (jump ** 2) / 2
jump -= 1
else:
sjump = False
jump = 7
rdr()
pygame.quit()
pygame.quit()[/CODE]
винда 7
python 3.8.2
библиотека pygame