posted 17 years ago
Hi,
I wasn't sure whether to post in Micro Edition forum or not as this relates to my attempts to make a pong game for my phone. I'm trying to work my way through the simple games...if I can master Pong, Tetris will be next!
The problem I'm having is that I'm unsure as to how to get the ball to move at angles from a paddle once it strikes one.
Currently how I'm trying to do it is:
I've tried to get the ball to move by changing its x direction when it collides with a paddle (so dx = 1, then dx = -dx) but the ball does not move very realistically as it seems to always head back in the same direction after each collision.
I was thinking that I could check to see what section of the paddle the ball collided with and use that to pick which value to set dx as -1 / +1.
I'd be really grateful of any tips, I don't really want to go looking at other people's source code on the net.
Thanks
Tony
Never trust a computer you can't throw out a window - Steve Wozniak