Форум сайта python.su
0
Здравствуйте.
Помогите, пожалуйста, с pygame
Нижеприведенный код работает без ошибок, но цвет фона окна не изменяется.
import sys import pygame def run_game(): pygame.init() screen = pygame.display.set_mode((900, 600)) pygame.display.set_caption("Alien Invasion") bg_color = (230, 230, 230) while True: for event in pygame.event.get(): if event.type == pygame.QUIT: sys.exit() screen.fill(bg_color) pygame.display.flip() run_game()
Отредактировано rascally_rabbit (Май 10, 2018 21:53:20)
Офлайн
76
import sys import pygame def run_game(): pygame.init() screen = pygame.display.set_mode((900, 600)) pygame.display.set_caption("Alien Invasion") bg_color = (230, 230, 230) screen.fill(bg_color) pygame.display.flip() while True: for event in pygame.event.get(): if event.type == pygame.QUIT: sys.exit() run_game()
Офлайн
0
Спасибо, все работает!
Офлайн