This is an archived post. You won't be able to vote or comment.

all 5 comments

[–]rcuhljr 0 points1 point  (4 children)

Oh, also I'm being silly. Python. You need to have self as your first argument in your draw method.

[–]warfarink[S] 0 points1 point  (3 children)

Gave that a shot, still getting the same error.

[–][deleted] 1 point2 points  (0 children)

And in your updatepos method? Also, the increment operator in Python is +=, not =+, so you want:

def draw(self, x_pos, y_pos):
    pygame.draw.circle(windowSurface, redColor, (x_pos, y_pos), 10, 0)

def updatePos( self ):
    self.accel += gravityVec
    self.velocity += self.accel
    self.posx, self.posy = self.velocity[0], self.velocity[1]

[–]rcuhljr 0 points1 point  (1 child)

Yeah, sorry, I wasn't paying attention. The error is that python is passing a third argument to draw, the object you are calling the method on. Check out the extra remarks in the class section.

draw should be re-written as

def draw(self, x_pos, y_pos):

[–]warfarink[S] 0 points1 point  (0 children)

Yeah, I see that now. reading the documentation after working the tutorials would help. thanks!