1. Windows
2. Python 3.8
3. Только PyGames
4.
2. Python 3.8
3. Только PyGames
4.
Python:
import pygame
pygame.init()
win = pygame.display.set_mode((1000,1000,))
pygame.display.set_caption ("AlerGames")
x=50
y=50
width = 40
height= 60
speed = 5
run= True
while run:
pygame.time.delay(100)
for event in pygame.event.get():
if event.type == pygame.QUIT:
run = False
keys = pygame.key.get_pressed()
if keys [pygame.K_LEFT]:
x -= speed
if keys [pygame.K_RIGHT]:
x += speed
if keys [pygame.K_DOWN]:
y += speed
if keys [pygame.K_UP]:
y -= speed
win.fill((0,0,0))
pygame.draw.rect (win,(0,0,255), (x,y,widht,height)
pygame.display.update()
pygame.quit()