I'm making a game where a paddle is used to bounce a ball around. However, the4 paddle, at certain angles of impact by the ball, shows a certain "stickiness" - the ball just vibrates on the paddle and the score is affected in a rapid fire fashion. Does any one know how to solve this problem?
You may see the game at http://scratch.mit.edu/projects/lmps/1186889
Offline
Its because the ball goes into the paddle, turns 180 and moves however many steps but its still in the paddle.
So it turns another 180 (Back downwards) and moves another how many steps and keeps doing that until the paddle move.
You can fix it by making the ball slower, or making it so it moves a few extra steps to make sure its out of the paddle after it bounces.
Offline
Yep, Colorfusion got it right - it's just that it can't get out of your paddle before it senses it's being hit by the paddle and turns around again.
Another easy way to solve this is to simply make it move away from the paddle twice - because it probably won't hit the other paddle within 2 steps.
So, for instance:
if <touching paddle>
turn 180 degrees
move 3 steps
move 3 steps
end if
Should work great!
Offline