Traceback (most recent call last):
File "c:\Users\davey\OneDrive\Documents\Python\Game\game.py", line 64, in <module>
bullet.draw(wn)
TypeError: bullet.draw() missing 1 required positional argument: 'wn'
It literally shows bullet.draw(wn) above it, and then says that wn isn't there?
What am I doing wrong here? I know that it is passing self through like it should, but why is it not reading wn?
This is the code being called:
class bullet(object):
def __init__(self, x, y, color):
self.x = x
self.y = y
self.velocity = 5
self.color = color
def draw(self, wn):
pygame.draw.circle(wn, self.color, (self.x, self.y), 1)
and this is where its being called:
for bullets in bulletcount:
bullet.draw(wn)
What is going on?
source https://stackoverflow.com/questions/75715989/missing-required-argument-when-argument-is-there
Comments
Post a Comment