I'm having a problem making the ball decrease after it hits the border "m". Y is ++ at first but when it hits "m" I have it so Y is -- but it basically cancels the ++ Y therefore the ball does not increase. How can I get the ball to bounce back off the wall?
Because it doesn't work. After reading what you wrote, I tried it, and it didn't work. First of all
make it -1 if you want to go down and +1 if you want to go up
doesn't make sense because using the y-axis in an applet it should be +1 for down and vice versa. I'm sorry for what i said about having something garenteed to work but this peice of code is getting to me. All I want is for the ball to bounce off walls. But theres something I'm missing... that I just can't think of. if Japps way does work, can somebody explain more?
Thanks for your help... all of you. I got it to bounce. I didn't mean to be an ass about it, and I apologize if I have offended anybody. I changed the code a bit. Now I'm at the part where I have to move the computers paddle. You can see I have it set to yy = Y which means when the ball moves one way, the paddle moves that way as well. But it only works on the balls first start movement and it moves until it hits the first wall. Then, the paddle sits still. How can I get it to move up with the Ball?
CR - its Woodstock, New brunswick. And yes I did mean to... then I looked at it after you mentioned it, and... well... I don't know... what.... i was.... thinking.... [ April 29, 2006: Message edited by: Martin vanPutten ]