# Can someone help me?!

**URL:** https://forum.kirupa.com/t/can-someone-help-me/133390
**Category:** Uncategorized
**Created:** [January 8, 2005, 12:52am UTC](https://forum.kirupa.com/t/can-someone-help-me/133390 "2005-01-08T00:52:40Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![von\_dragon](https://avatars.discourse-cdn.com/v4/letter/v/edb3f5/32.png) [@von\_dragon](https://forum.kirupa.com/u/von_dragon)
#### Post date: [January 8, 2005, 12:52am UTC](https://forum.kirupa.com/t/can-someone-help-me/133390/1 "2005-01-08T00:52:40Z")

</div>

Does anyone know what’s wrong with the following code, it’s not working for me. It’s for a pong game im making. Only the last part isn’t working but the rest is ok. I want the ball to bounce off in a different direction if it hits the egdes than it would if it hits the middle.

```auto
 game.checkPaddleCollisions = function() { 
if (this.ball.tempx<THIS.LEFTPADDLE.X+THIS.LEFTPADDLE.WIDTH && this.ball.tempx+this.ball.radius>this.leftPaddle.x && this.ball.tempy+this.ball.radius>this.leftPaddle.y && this.ball.tempy<THIS.LEFTPADDLE.Y+THIS.LEFTPADDLE.HEIGHT) {< p> 
//left paddle collision detection
this.ball.tempx = this.leftPaddle.x+this.leftPaddle.width;
this.ball.xmov *= -1;
this.ball.xmov += .15;
soundIdentifier.start();
if (38<THIS.BALL.TEMPY)< p> this.ball.ymov *= 1.1;
else if (38>this.ball.tempy)
this.ball.ymov *= .1;
}
if (this.ball.tempx<THIS.RIGHTPADDLE.X+THIS.RIGHTPADDLE.WIDTH && this.ball.tempx+this.ball.radius>this.rightPaddle.x && this.ball.tempy+this.ball.radius>this.rightPaddle.y && this.ball.tempy<THIS.RIGHTPADDLE.Y+THIS.RIGHTPADDLE.HEIGHT) {< p> 
//right paddle collision detection
this.ball.tempx = this.rightPaddle.x-this.ball.radius;
this.ball.xmov *= -1;
this.ball.xmov -= .15;
soundIdentifier.start();
}
};

```

I have attached my fla. if anybody wants to tinker with it to make it work. Its in MX 2004 Professional.
