但是主程序 alien_invasion.py 调用时,总是说没有属性screen_width 这个类,如何解决?(标签-Python|关键词-Set)

各位好,我遇到一个小问题,举手之劳,感激不尽,再次感谢!

Python编程从入门到实践中第12章中编写“创建设置类” Settings.py 。但是主程序 alien_invasion.py 调用时,总是说没有属性screen_width 这个类

img


```python
class Settings():
    """存储《外星人入侵》的所有设置的类"""

    def __int__(self):
        """初始化游戏的设置"""
        #屏幕设置
        self.screen_width = 1200
        self.screen_height = 800
        self.bg_color = (230, 230, 230)



import sys

import pygame

from settings import Settings

def run_game():
    # 初始化pygame、设置和屏幕对象 
    pygame.init()
    ai_settings = Settings()
    screen = pygame.display.set_mode(
        (ai_settings.screen_width, ai_settings.screen_height))
    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(ai_settings.bg_color)
        
        # 让最近绘制的屏幕可见
        pygame.diaplay.flip()

run_game()

```