What you need to see are the kinematics equations, which you can read about here: http://www.physicsclassroom.com/Class/1DKin/u1l6a.cfm
The one that applies here states that distance equals initial velocity plus half acceleration times time squared, that's
d = i + ( a * t^2 ) / 2 when i equals initial velocity.
Assuming no air resistance, your acceleration on the x axis will be constant, and your acceleration on the y axis will be that of gravity, that's 9.8 m/s^2. The total velocity equals velocity on the x axis plus velocity on the y axis. We want to relate the total velocity, a vector, to the velocity on the x axis, another vector, with an angle (E for angle of elevation) between the two. Because we're working on the Cartesian plane which features x and y axes perpendicular to each other, we can use a trigonometric ratio, cosine E equals velocity on the x axis over total velocity. Use this to find the initial velocity on the x axis.
What you need to do now is to solve for time on the y axis and plug that in to find distance on the x axis. This is made simple given the fact that distance (d) will be zero on the y axis (what comes up must come down), so we substitute that into our equation and solve. 0 = i + ( -9.8 * t^2 ) / 2 Since initial velocity (i) is a constant, we can easily find that through experimentation.* Before we do either of those thing, our equation for distance on the x axis will look like this: d = i + ( 1 * t^2 ) / 2 because we're assuming no air resistance.
*For example by shooting the nerf gun, timing it, measuring the distance and working backward from there using your equation. You could even do this at varying angles to try to approximate air resistance.
I'm a bit rushed in writing this as I'm on a library computer and it's getting close to closing time, so I apologize for an discrepancies, please pm me if you find me in error. If you liked this answer please follow me on Quora: https://www.quora.com/Azeezah-M