This is a read-only archive of the old Scratch 1.x Forums.
Try searching the current Scratch discussion forums.

#1 2010-07-12 14:12:54

lmps
New Scratcher
Registered: 2010-07-01
Posts: 1

"Sticky" Objects

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

 

#2 2010-07-12 15:13:41

colorfusion
Scratcher
Registered: 2009-10-03
Posts: 500+

Re: "Sticky" Objects

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

 

#3 2010-07-12 17:36:09

coolstuff
Community Moderator
Registered: 2008-03-06
Posts: 1000+

Re: "Sticky" Objects

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

 

Board footer