Breakout clone help

Blitz3D Forums/Blitz3D Beginners Area/Breakout clone help

The forum is locked. These are the original blitzbasic.com forums, kept so they can still be read. No new topics, replies or edits can be made here. To join in, head over to the Blitz3D+ forums.

Lol, i tried to do this:

newspeedx = (ball_x - player_x)

;Blah blah the rest of the movement function

If RectsOverlap(ball_x,ball_y,15,15,player_x,player_y,100,20) Then bal_ydir = -1 bal_xdir = newspeedx



notice the:
bal_xdir = newspeedx


after the collision with the paddle, but when it hits it flys off at a million miles per hour to the right. And returns to normal speed when it hits the wall and bounces