A
Anti-Icarus
Guest
For a few months, I was working on a Pong clone as shown by the following screenshot:
I created it using the drag and drop method due to its simplicity. I have it basically working with the intention of putting in a few more tweeks to the gameplay. Now I have come across a few collision issues with the ball. As you can see in the screenshot, the game consists of two vertical rectangles that are paddles and the square ball. I set up the ball so that it would collide on the two paddles just like in the original Pong. When it collides with the left paddle, it moves freely in the direction of obj_Paddle1.y-y at the speed of 10. When it collides with the right paddle, it moves freely in the direction of 180+obj_Paddle2.y-y at the speed of 10. When it collides on either the top or bottom walls, it bounces precisely against them as solid objects.
During my play tests, I've encountered two issues regarding the collision of the ball, which may be more likely because that it's in the shape of a square. Sometimes, the ball just endlessly bounces up and down between the top and bottom walls. At other times, the ball and a paddle become frozen in position when the former collides on the top or bottom part of the latter. I can assume that it can be resolved easily by changing the ball's sprite from a square to a circle. Would that be sufficient enough?
I created it using the drag and drop method due to its simplicity. I have it basically working with the intention of putting in a few more tweeks to the gameplay. Now I have come across a few collision issues with the ball. As you can see in the screenshot, the game consists of two vertical rectangles that are paddles and the square ball. I set up the ball so that it would collide on the two paddles just like in the original Pong. When it collides with the left paddle, it moves freely in the direction of obj_Paddle1.y-y at the speed of 10. When it collides with the right paddle, it moves freely in the direction of 180+obj_Paddle2.y-y at the speed of 10. When it collides on either the top or bottom walls, it bounces precisely against them as solid objects.
During my play tests, I've encountered two issues regarding the collision of the ball, which may be more likely because that it's in the shape of a square. Sometimes, the ball just endlessly bounces up and down between the top and bottom walls. At other times, the ball and a paddle become frozen in position when the former collides on the top or bottom part of the latter. I can assume that it can be resolved easily by changing the ball's sprite from a square to a circle. Would that be sufficient enough?