# Ball bouncing off paddle

**URL:** <https://forum.kirupa.com/t/ball-bouncing-off-paddle/206011>\
**Category:** Uncategorized\
**Created:** [November 4, 2006, 1:31am UTC](https://forum.kirupa.com/t/ball-bouncing-off-paddle/206011 "2006-11-04T01:31:18Z")\
**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:** [November 4, 2006, 1:31am UTC](https://forum.kirupa.com/t/ball-bouncing-off-paddle/206011/1 "2006-11-04T01:31:18Z")

</div>

Hi im was wondering if anyone knows the script for a ball bouncing off a paddle. I want the ball to bounce off the paddle in different directions depending on:

1. which side of the paddle it hits
2. which direction it came from

Ive only got this so far : script for the paddle

onClipEvent(enterFrame)  
{  
if (this.hitTest(\_parent.ball)) //if this movieclip hits the movieclip ‘ball’  
tellTarget(\_root.ball) //tell the ball to:  
{  
speedX = speedX; //X speed will stay constant  
speedY = -speedY; //Y speed will be reversed (direction is reversed)
