Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import pygame
- #Константы
- WIDTH = 800
- HEIGHT = 600
- FPS = 60
- BLACK = (0,0,0)
- #Создаем игру и окно
- pygame.init()
- screen = pygame.display.set_mode((WIDTH,HEIGHT))
- pygame.display.set_caption("Battle City")
- clock = pygame.time.Clock()
- #Цикл игры
- running = True
- while running:
- #Держим скорость цикла (контролируем ФПС)
- clock.tick(FPS)
- #Ввод (захват) события
- for event in pygame.event.get():
- #Если нажали на крестик, закрываем игру
- if event.type == pygame.QUIT:
- running = False
- #Обновление игровых объектов
- #Рендеринг
- screen.fill(BLACK)
- #После отрисовки всех объектов показываем игроку игровое поле
- pygame.display.flip()
- pygame.quit()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement