/* We define Y as first dimension, making the vertical direction the main and static projectile speed. The ternary expressions makes sure the projectile object may travel in either direction. */ FirstDimensionLength = (start_y>stop_y?start_y-stop_y:stop_y-start_y); SecondDimensionLength = (start_x>stop_x?start_x-stop_x:stop_x-start_x); NumberOfSteps = FirstDimensionLength / PixelsPerStepFirstDimension; PixelsPerStepSecondDimension = Math.round(SecondDimensionLength / NumberOfSteps); for(loop_a=0; loop_a<=NumberOfSteps; loop_a++) { next_y = (next_y<stop_y?next_y+PixelsPerStepFirstDimension:next_y-PixelsPerStepFirstDimension); next_x = (next_x<stop_x?next_x+PixelsPerStepSecondDimension:next_x-PixelsPerStepSecondDimension); PathArray.push([next_x,next_y]); }
