Thread: Ping pong game
View Single Post
  #1 (permalink)  
Old 03-18-2008, 05:53 PM
adam405 adam405 is offline
Member
 
Join Date: Mar 2008
Posts: 7
adam405 is on a distinguished road
Ping pong game
I have already got

Code:
if(sliderx_pos == x_pos && y_pos ==148) { x_speed *= -1; y_speed *= -1; }
The problem is that if the ball lands an any part the the slider it needs to bounce. At the moment its only bouncing off the far left hand side which represents the sliderx_pos. So i need away to say if the ball hits any part of the slider then bounce.

The slider width is 60 therefore i need away to say

if ball position is between 145 amd 205 then bounce.

Hope this makes sense.

Last edited by adam405 : 03-18-2008 at 06:22 PM.
Reply With Quote
Sponsored Links