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
if anim + 1 >= 30:
anim = 0
if run:
win.blit(run[anim // 5], (x, y))
else:
win.blit(runnot, (x, y))
win.blit(bq, (0, 0))
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()
python 3.8.2
библиотека pygame