我正在做一个游戏作为一个有趣的副项目,我遇到了这个错误,我真的不知道为什么会发生。。。
代码如下:class players:
def init(self, location, image_file, direction):
self.location = location
self.image_file = image_file
self.direction = direction
self.rect = self.image_file.get_rect()
def turn(self, direction, playerImages):
keys = pygame.key.get_pressed()
if keys[pygame.K_a] == True:
self.direction -= 1
if self.direction < -3:
self.direction = 3
if keys[pygame.K_d] == True:
self.direction = 1
if self.direction > 3:
self.direction = 3
if self.direction == -3:
self.image_file = playerImages[0]
if self.direction == -2:
self.image_file = playerImages[1]
if self.direction == -1:
self.image_file =
Original: https://blog.csdn.net/weixin_32589877/article/details/111919790
Author: 五条人
Title: python位置参数错误_类型错误:缺少一个必需的位置参数
原创文章受到原创版权保护。转载请注明出处:https://www.johngo689.com/782400/
转载文章受原作者版权保护。转载请注明原作者出处!