I have created an object an included a function with 3 parameters, however, the program won't pick up my last parameter dy.
The code
class blaster(object):
def __init__(self,x,y,r):
self.x = x
self.y = y
self.radius = r
self.xvelocity = 5
self.yvelocity = 0
self.blastercount = 0
self.isblasting = False
self.xarray = []
self.yarray = []
self.xcounter = []
self.ycounter = []
def initiate_blast(self,xx,yy,dx,dy):
self.xarray.append(int(mn.x))
self.yarray.append(int(mn.y))
self.xcounter.append(int(dx))
self.ycounter.append(int(dy))
The function gets called:
blaster.initiate_blast(troop.x,troop.y,5,5)
The output:
TypeError: initiate_blast() missing 1 required positional argument: 'dy'