Created
April 20, 2020 20:59
-
-
Save LevBravE/19ad8081092a8fc11a97d6897d3ee7fe to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import pygame | |
size = width, height = 301, 301 | |
screen = pygame.display.set_mode(size) | |
clock = pygame.time.Clock() | |
running = True | |
x_pos = 0 | |
v = 20 # пикÑелей в Ñекунду | |
fps = 60 | |
while running: | |
# внутри игрового цикл еще один цикл | |
# приема и обработки Ñообщений | |
for event in pygame.event.get(): | |
# при закрытии окна | |
if event.type == pygame.QUIT: | |
running = False | |
# отриÑовка и изменение ÑвойÑтв объектов | |
# ... | |
screen.fill((0, 0, 0)) | |
pygame.draw.circle(screen, (255, 0, 0), (int(x_pos), 200), 20) | |
x_pos += v / fps | |
clock.tick(fps) | |
# обновление Ñкрана | |
pygame.display.flip() | |
pygame.quit() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment