Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import pygame
- import random
- WIDTH = 360
- HEIGHT = 480
- FPS = 30
- # Задаем цвета
- WHITE = (255, 255, 255)
- BLACK = (0, 0, 0)
- RED = (255, 0, 0)
- GREEN = (0, 255, 0)
- BLUE = (0, 0, 255)
- # Создаем игру и окно
- pygame.init()
- screen = pygame.display.set_mode((WIDTH, HEIGHT))
- pygame.display.set_caption("My Game")
- clock = pygame.time.Clock()
- # Цикл игры
- running = True
- while running:
- # Ввод процесса (события)
- for event in pygame.event.get():
- # check for closing window
- if event.type == pygame.QUIT:
- running = False
- # Держим цикл на правильной скорости
- clock.tick(FPS)
- pygame.quit()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement