I am noticing that I am setting some attributes of the photon in the Photon's constructorDuplicateFactory method, and some in the PhotonBeam update animation frame method. For instance, the random offset for the y-velocity (fanning) is determined in the Photon class, while the random offset to the x-location is determined in the PhotonBeam class (because it depends of dt). Seems like there is probably a cleaner way to handle this.
Yes, as we discussed, it would be better to pass in the x-offset to the createFromPool function so that the value can be created with the right value initially.
I am noticing that I am setting some attributes of the photon in the Photon's constructorDuplicateFactory method, and some in the PhotonBeam update animation frame method. For instance, the random offset for the y-velocity (fanning) is determined in the Photon class, while the random offset to the x-location is determined in the PhotonBeam class (because it depends of dt). Seems like there is probably a cleaner way to handle this.