pygame
SCREEN_WIDTH=SCREEN_HIGHT=BG_COLOR=pygame.Color()
MainGame():
window=():
():
pygame.display.init()
MainGame.widow=pygame.display.set_mode([SCREEN_WIDTHSCREEN_HIGHT])
pygame.display.set_caption()
:
MainGame.window.fill(BG_COLOR)
pygame.display.update()
():
Tank():
():
():
():
():
MyTank():
():
EnemyTank(Tank):
():
().()
Bullet():
():
():
():
Wall():
():
():
Explode():
():
():
Music():
():
():
__name__==:
MainGame().startGame()
C:\Users\86137\PycharmProjects\mypro01\venv\Scripts\python.exe C:/Users/86137/PycharmProjects/mypro01/tanke01.py
pygame 2.0.1 (SDL 2.0.14, Python 3.9.2)
Hello from the pygame community. https://www.pygame.org/contribute.html
Traceback (most recent call last):
File "C:\Users\86137\PycharmProjects\mypro01\tanke01.py", line 101, in <module>
MainGame().startGame()
File "C:\Users\86137\PycharmProjects\mypro01\tanke01.py", line 48, in startGame
MainGame.window.fill(BG_COLOR)
AttributeError: 'NoneType' object has no attribute 'fill'
Process finished with exit code 1
运行的时候为什么是fill错误呀、、、