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

#1 2009-06-13 20:26:07

joebab
Scratcher
Registered: 2009-06-13
Posts: 8

My game has glitch, can anyone help?

Alright this is the URL http://scratch.mit.edu/projects/joebab/569323 for some reason the ball sort of sticks to the paddles and i can't fix it.
Any help?
thanks

Offline

 

#2 2009-06-13 21:26:28

kgordon
Scratcher
Registered: 2009-02-26
Posts: 100+

Re: My game has glitch, can anyone help?

<point in direction( (( 180 <-> <direction> ))

is not a perfect bounce no matter what, it only works on surfaces above or below the ball, for the side paddles you need to use

<if><touching[ side paddle <point in direction( (( 0 <-> <direction> ))

Last edited by kgordon (2009-06-13 21:27:03)

Offline

 

#3 2009-06-14 05:52:41

Paddle2See
Scratch Team
Registered: 2007-10-27
Posts: 1000+

Re: My game has glitch, can anyone help?

Sticky paddles are often caused by the ball changing direction more times than you really want it to, after you sense a collision.  Be sure to put a WAIT after you change direction to give the ball time to get clear of the paddle before you start looking for the next collision.

If I am looking for the color black, for example, I will set up a Forever Loop looking for black, change the direction in it, then wait until NOT touching black before letting the loop continue, something like this

[blocks]
<when green flag clicked>
<forever if><touching color[ black
<turn cw(  ((  180 <+> <pick random( -30 )to( 30 )))degrees>
<wait until><<  <not> <touching color[ black >>
<end>
[/blocks]


http://i39.tinypic.com/2nav6o7.gif

Offline

 

Board footer