Advertisement
kasper_k

Pygame_temp

Apr 14th, 2022
80
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.71 KB | None | 0 0
  1. import pygame
  2. import random
  3.  
  4. WIDTH = 360
  5. HEIGHT = 480
  6. FPS = 30
  7. # Задаем цвета
  8. WHITE = (255, 255, 255)
  9. BLACK = (0, 0, 0)
  10. RED = (255, 0, 0)
  11. GREEN = (0, 255, 0)
  12. BLUE = (0, 0, 255)
  13. # Создаем игру и окно
  14. pygame.init()
  15. screen = pygame.display.set_mode((WIDTH, HEIGHT))
  16. pygame.display.set_caption("My Game")
  17. clock = pygame.time.Clock()
  18. # Цикл игры
  19. running = True
  20. while running:
  21.     # Ввод процесса (события)
  22.     for event in pygame.event.get():
  23.         # check for closing window
  24.         if event.type == pygame.QUIT:
  25.             running = False
  26.     # Держим цикл на правильной скорости
  27.     clock.tick(FPS)
  28.  
  29. pygame.quit()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement