0 down vote favorite Im helping my friend out with a pygame but we are stuck
so wereWe're are trying to get the direction of a projectile but we cantcan't find out how
forFor example:
[1,1] will go SE
[1,-1] will go NE
[-1,-1] will go NW
and [-1,1] will go SW
we need an equation of some sort that will take the player pos and the mouse pos and find which direction the projectile needs to go.
hereHere is where we are plugging in the vectors:
def update(self):
self.rect.x += self.vector[0]
self.rect.y += self.vector[1]
thenThen we are blitting the projectile at the rects coords
if you want to see all the code here is the repo