1 person found this helpful
If you want the trig solution, you probably want to find a math forum or maybe a gaming tutorial that involves that aspect. If you tilt the wall, the angle of the rotation is impacted by twice the value of the wall's angle, either adding to or subtracting from depending angle of the wall relative to the perpendicular. So if the bullet comes in at 45 degrees relative to horizontal, and wall is tilted +10 degrees relative to the vertical, the rotation will be -45 + (2 * 10) = -25 degrees. If the wall is at -10 degress relative to the vertical under the same bullet condition, the rotation will be -45 + (2 * -10) = -65 degrees.
Thanks for the help, It got me some where but not quite there yet. I have this.
var reflect = (this._rotation +(2 * 10));
this._rotation *= reflect;
For some reason no matter what it reflects the bullet straight down at the ground.
If coming into the wall you have "this._rotation", then bouncing off the wall you will have...
this.rotation = 2*wall._rotation - this._rotation;
Thank you so much, no seriously I was worried I would never find a solution to this problem. It's working now, not perfectly angles are a bit off, but working just fine for now!