# Why doesnt this work!

**URL:** <https://forum.kirupa.com/t/why-doesnt-this-work/133454>\
**Category:** Uncategorized\
**Created:** [January 8, 2005, 6:42pm UTC](https://forum.kirupa.com/t/why-doesnt-this-work/133454 "2005-01-08T18:42:17Z")\
**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, 6:42pm UTC](https://forum.kirupa.com/t/why-doesnt-this-work/133454/1 "2005-01-08T18:42:17Z")

</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.

[left]

```auto
[/left]
[left]game.checkPaddleCollisions = function() {[/left]
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) {
//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)
this.ball.ymov *= 1.1;
else if (38>this.ball.tempy)
this.ball.ymov *= .1;
}
[left]};[/left]
[left]

```

[/left]

no syntax errors come up and its not doing what i want it to do

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