if, however, you want to keep going like this (it's the core mechanic, for example) then it's time for a basic physics lesson:
Newton's third law states that for every action there is an equal and opposing reaction.
An object in motion likes to stay in motion, and an object as rest likes to stay at rest. That and the third law combined create the "bounce" (ricochet) that is seen.
The thing about firearms is that you basically have a crapton of kinetic energy stored in a single projectile. Obviously when the bullet is travelling through the air it faces some air resistance and gravitational pull, which slows the bullet down and pulls the bullet toward the ground more and more as time goes on. Some bullets take the shape design of arrows, which help to decrease air resistance.
Bullets are also lightweight and can be pushed from side to side easily (wind) - which is why a mile-long shot (the JFK assassination) requires the best snipers one can have, and wind gauges along the way.
I am absolutely horrible with math, so let's see how far off I can get.
Kinetic energy is measured in Joules, which is:
(mass*velocity^2)/2
mass would be kilograms and velocity would be meters.
a .45 caliber bullet will weight approximately 0.0162Kg and the muzzle velocity is about 290 meters per second. We will take this as our example bullet.
so, plugging in the numbers, you will get:
(0.0162 * 290 ^ 2) / 2 = 681.21 Joules of kinetic energy when a .45 cal bullet leaves the gun.
Generally speaking that kind of bullet is large, bulky, does not shatter easily, and does terribly against wind and air resistance.
air resistance is measured as such: (by NASA)
(Cd*A*Rho*V^2)/2
Cd is the coefficient of drag, A is the cross-section of the bullet, Rho is the air density, and V is velocity (in meters, I believe)
a cylindrical object will have 0.295 as Cd, and the average air density in the US at 0 degrees Celsius is 1.292 Kg/m3
we'll assume 3D space and say the length of the stage is 100 pixels.
we'll say that each pixel is a meter, which would leave your stage at 800x600 meters (easy enough to remember)
so, plugging that in:
1.292 * (800 * 600 * 100) = 62016000 Kg or air density for the entire space (it's quite a large area, remember)
so we're still missing A. Since the cross-section of a cylinder is a circle, we just need to find the area of a circle (basic geom: a = pi * radius ^ 2) - a .45 cal bullet has the diameter (twice the radius) of .45 inches (herpaderp), or about 11.5mm. Since we're dealing with meters, i'll leave it at 0.0115 meters.
so, plugging that in:
3.14 * (0.0115 / 2) ^ 2 = 0.00010381625 meters
so using all of this, we get:
(0.295 * 0.00010381625 * 62016000 * 290 ^ 2) / 2 = 79865111.91966 m/w.c.
^now that doesn't look right, does it? I'll wait for a math whiz to come by and correct me.
in the meantime, i've had enough math for today.
in the meantime, say that the bullet loses .10 joules of energy per meter. That should help your physics along a bit.
low let's assume that the bullet is made of rubber. Since rubber retains is joules quite well, we'll say that it only loses 45% of its total energy when it hits the wall dead-on (which is where you would lose the most energy)
We'll also say that for every degree added to the angle, it loses 0.5% fewer joules of energy. This means if you're shooting perpendicular to the wall, it'll lose no energy bouncing off the wall because it didn't bounce off the wall (even if it's touching the wall and you're calculating the math)
now we'll assume that the bullet won't lose it's shape when it hits the wall (how that works i'll have no idea)
you will need to take the front end of the bullet and turn it into a circle, then rotate that circle faster the more of an angle there is. Friction plays a role here.
let's say that there is always 100% friction upon impact as far as rotating the bullet is concerned. We'll lose an additional 0.01 joules of energy there. For every degree of angle the bullet hits the wall with, rotate the bullet an additional 0.75 degrees.
now what if the back end of the bullet hits the wall as soon as the bullet leaves?
The bullet loses an additional 0.01 joules and reverses the rotation, minus 10% rotation.