I'm trying to make a small pariticle-like simulation, and I'm trying to make each parrticle go a random direction from one point (mouse pos). The problem is I don't know how to get the random vector that has a certain speed.
Here is what I'm trying to get the vector:
def getVector(self): vector = [random.randint(-100, 100), random.randint(-100, 100)] return vector
when I run this each particle goes either north, west, or northwest. The odd thing is when I tried to record a .gif to show this behavior the frame-rate of the .gif was 15 fps (slow comp) and the particles actually went in all directions. So in my code where I move the particles:
self.rect.x -= self.vector * ttime self.rect.y += self.vector * ttime
I took away the
ttime (the tick to regulate speed) and it worked but the particles were going very fast at various speed. So my question is how can i get a random vector that will give me the correct behavior