I've tried to run the code as normal, however I was met with a error which looks something like this
Traceback (most recent call last):
File "H:\Coursework assets\gametest1.py", line 85, in <module>
wizard.move(wizard.x)
AttributeError: 'tuple' object has no attribute 'move'
Below is the class for the original player Player class for the main character. Where the error may have originated from
class player:
def __init__(self,x,y):
self.x = x
self.y = y
self.standing = True
self.left = False
self.right = True
self.vel = 15
def move(self,x,y):
if not(self.standing):
if k[pygame.K_LEFT] and self.x > 0 - 150:
self.left = True
self.right = False
self.x -= self.vel
elif k[pygame.K_RIGHT] and self.x < 500 - 150 :
self.right = True
self.left = False
self.x += self.vel
else:
self.standing = True
run = True
Main game loop
wizard = (25,420)
while run:#main game loop
pygame.time.delay(15)
wizard.move(wizard.x,wizard.y)
win.blit(bg,(0,0))
wizard.jump(wizard.y)
wizard.draw(win))
pygame.display.update()
pygame.quit()