This is not a trivial problem. Your current method gives you initial starting positions. You will also want to generate starting 'velocities' which I will call VX and VY.
That is, store X,Y position arrays as well as VX and VY direction arrays where each 'line' of VX and VY has a constant norm. You will then increment each position X,Y by their corresponding VX and VY each iteration, then check if you are against a wall, and then change the VX and VY for points hitting the wall in such a way that they 'bounce' off of it.
Hopefully, this gets you started! Good luck.