[url=“http://www.danieltodd.com/”]
Hi there,
I am making a pong game where the game is played on the x axis.
** I have a code (displayed below) that is a simple hit detection:**
//paddle1 hit ball
if (_root.ball.hitTest(_root.paddle1)) {
_root.xspeed = -_root.xspeed;
_root.audio.gotoAndPlay(“metal_hit”);
}
What i want to do with this code, is a hit detection where when the ball hits the paddle on a certain part of the paddle on the y axis and bounces on a sharper or straighter angle depending on where the ball hits the paddle. (EG. very tip of the paddle bounces off sharper, middle of paddle bounces of straighter.
Im sure there is some examples of code out there for this kind of technique, but i have had no luck so far.
Can any one out there please help me???
Cheers
Peter.D