AttributeError:

AttributeError: 'AlienInvasion' object has no attribute 'settings'. Did you mean: 'settngs'?
麻烦指点下

import sys

import pygame

from settings import Settings
from ship import Ship


class AlienInvasion:

    def __init__(self):
        pygame.init()
        self.settngs = Settings()

        self.screen = pygame.display.set_mode(
            (self.settngs.screen_width, self.settngs.screen_height))
        pygame.display.set_caption("AlienInvasion")

        self.ship = Ship(self)
    def run_game(self):

        while True:
            # Watch for keyboard and mouse events.
            for event in pygame.event.get():
                if event.type == pygame.QUIT:
                     sys.exit()
            # Redraw the screen during each pass through the loop.
            self.screen.fill(self.settings.bg_color)
            self.ship.blitme()

            # Make the most recently drawn screen visible.
            pygame.display.flip()


if __name__ == '__main__':
    # Make a game instance, and run the game.
    ai = AlienInvasion()
    ai.run_game()


self.settngs = Settings()
这不是你自己写的吗,变量名叫settngs
尽量使用IDE给你自动生成的成员列表里面选
要么就敲一次之后复制粘贴
不要每次都手敲还总敲错

self.settngs
这里是 settngs
建议修改为 settings