IPhone SDK help with minigame
<p>right basically what ive got is an app which is a ball and bat and its how many bounces you can achieve, it works alright but there is one problem,</p>

<p>when the ball hits the side of the bat it throws it off course and its like the frame of the ball is bouncing in the frame of the bat, Here is my code in my mainview.m</p>

<pre><code>#import "MainView.h"
#define kGameStateRunning 1

@implementation MainView
@synthesize paddle, ball;

- (void)touchesMoved:(NSSet *)touches withEvent:(UIEvent *)event {
UITouch *touch = [[event allTouches] anyObject];
CGPoint location = [touch locationInView:touch.view];
CGPoint xLocation = CGPointMake(location.x,paddle.center.y);
paddle.center = xLocation;
}

-(IBAction) play {
pos = CGPointMake(14.0,7.0);
[NSTimer scheduledTimerWithTimeInterval:0.05 target:self     selector:@selector(onTimer) userInfo:nil repeats:YES];
}

-(void) onTimer {
ball.center = CGPointMake(ball.center.x+pos.x,ball.center.y+pos.y);

if(ball.center.x &gt; 320 || ball.center.x &lt; 0)
 pos.x = -pos.x;
if(ball.center.y &gt; 460 || ball.center.y &lt; 0)
 pos.y = -pos.y;
[self checkCollision];
}

-(void) checkCollision {

 if(CGRectIntersectsRect(ball.frame,paddle.frame)) {
   pos.y = -pos.y;

 }
}


@end
</code></pre>

<p>can anyone work out the problem here?
Thanks
Harry</p>
