返回数量函数len的使用
今天出现如下错误。前一步还好好的,
for enemyTank in MainGame.enemyTankList: enemyTank.displayTank() enemyTank.move()#加上这一行之后就显示出错了。不能按照视频里进行了 出现如下问题 Traceback (most recent call last): File "D:/python/study/坦克大战/tank11.py", line 252, in <module> MainGame().startGame() File "D:/python/study/坦克大战/tank11.py", line 46, in startGame self.blitEnemyTank() File "D:/python/study/坦克大战/tank11.py", line 66, in blitEnemyTank enemyTank.move() File "D:/python/study/坦克大战/tank11.py", line 171, in move self.rect.left += self.speed AttributeError: 'EnemyTank' object has no attribute 'speed'