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.

Alright i figured it out: somthing was wrong with the veriable, so i just make the bal_xdir=(ball_x - player_x)

The raw value, would be nice if i could dress it up later but still its good to know it works, anyways on to bigger problems:

i cant seem to figure out how to make it know when the ball hits a different side of the pillar.

This is what i use now to bounce the ball back when it collides:

  For p.pillar=Each pillar
   If RectsOverlap(p\X,p\Y,100,30,ball_x,ball_y,15,15) Then
   score=score+1
   Delete p
   bal_ydir=1
   End If
  Next


Now this works, but it only works if the ball hits it from the bottom, when it hits from the sides or the top it just keeps going.

Any ideas? btw thanks for all the help, if this goes well, this will be my first working game, and i'll credit you guys for helping me in my first steps to programming.