I am making a pong-like game for a class.
I am having trouble with the ball's collision detection.
The game is a 1 player version, where the ball and paddle are both contained in a box. The player uses a gun which is built into the paddle, in order to shoot a hole through the back wall so that the ball may escape (earning them a point)
I have also given the paddle 2-D movement, instead of just along the x-axis.
The ball seems to be bouncing off the side walls fine, but when it hits the top wall, it seems to "reset" the ball, and it just reappears near the paddle and starts moving again.
I also notice that when the ball is reflected off a wall toward the paddle, it seems to be attracted to the paddle like a magnet.
I tried to post my code, but it was giving me some error about "you do not have permission to create tags" or something like that.
I am wondering if there is a way to detect collision, based off of getpixel(), but for more than one pixel at a time. For example, since the ball is circular, instead of just testing one pixel in the direction that the ball is going, is it possible to getpixel() for a specific area of pixels instead of just one single pixel at a time? Does my question make sense?
Please help!
Thank you!!