# Ball bouncing off paddle

**URL:** <https://forum.kirupa.com/t/ball-bouncing-off-paddle/205315>\
**Category:** flash\
**Created:** [October 27, 2006, 11:42pm UTC](https://forum.kirupa.com/t/ball-bouncing-off-paddle/205315 "2006-10-27T23:42:34Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![vashthestampede](https://avatars.discourse-cdn.com/v4/letter/v/d07c76/32.png) [@vashthestampede](https://forum.kirupa.com/u/vashthestampede)\
**Post date:** [October 27, 2006, 11:42pm UTC](https://forum.kirupa.com/t/ball-bouncing-off-paddle/205315/1 "2006-10-27T23:42:34Z")

</div>

Hi, could anyone help me with actionscript for a ball boucning off a paddle?

ive managed to get the ball bouncing off the paddle, but now i want to specify which direction the ball should travel depending on which side of the paddle it hits.

This is wat ive written so far: the actionscript for the paddle

onClipEvent(enterFrame) {

{  
if (this.hitTest(\_root.ball)) //if the movieclip ‘ball’ hits this movieclip  
{

tellTarget(\_root.ball) //tell the ball to reverse the X and Y speed, thus  
//change directions  
{speedX = -speedX;  
speedY = -speedY;  
}  
}  
}  
}

PLease HELP ME!
