剛剛開始學習python 按照書上的一步一步的寫下代碼
但是老是報錯請哪位大神幫忙看看 為什么?
import sys
import pygame
from settings import Settings
def run_game():
pygame.init()
ai_settings = Settings()
screen = pygame.display.set_mode(
(ai_settings.screen_width, ai_settings.screen_height))
pygame.display.set_caption("Alien invasion")
while True:
for event in pygame.event.get():
if event.type == pygame.QUIT:
sys.exit()
screen.fill(bg_color)
pygame.display.flip()
run_game()
類
class Settings():
def _init_(self):
slef.screen_width = 1200
slef.screen_height = 800
self.bg_color =(230,230,230)
轉載請註明出處,本文鏈接:https://www.uj5u.com/qita/61398.html
標籤:其它游戲引擎
