#98217 - jbrain - Mon Aug 14, 2006 5:16 am
hello, would someone help me rewrite this bit of code...
b_xpos represents the ball and p_xpos represents the paddle etc...
The ball is an 8x8 sprite and the paddle is 8x32.
I havent done any programming in a few years so im a little new to this again. Any help would be great.
Code: |
/////////////////////////////////////////////////////////////// // check ball collision with paddle REWRITE SOON!!! if(b_xpos > p_xpos && b_xpos+8 < p_xpos +32) { if ((b_ypos+8) > (p_ypos)) { b_yvel = -b_yvel; // negatize the balls (y) velocity b_ypos += b_yvel; // update the balls (y) position } } /////////////////////////////////////////////////////////////// |
b_xpos represents the ball and p_xpos represents the paddle etc...
The ball is an 8x8 sprite and the paddle is 8x32.
I havent done any programming in a few years so im a little new to this again. Any help would be great.