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

#1 2013-03-22 12:19:54

KonceptZer0
New Scratcher
Registered: 2013-03-22
Posts: 3

Bouncing ball behaving erraticaly. Teleports around the screen on hit.

I'm trying to get a ball sprite to bounce on contact with wall (pong style) but the result appears to be some sketchy teleporting around the edges of the screen. Does anyone have any idea why this might be happening?

Offline

 

#2 2013-03-22 12:46:09

ErnieParke
Scratcher
Registered: 2010-12-03
Posts: 1000+

Re: Bouncing ball behaving erraticaly. Teleports around the screen on hit.

Well, it might be due to the fact that the center of your ball isn't where it should be, so you could check that. Also, this could be caused by your bouncing script. If you show it, I could look at it quickly.

With regards,

ErnieParke


http://i46.tinypic.com/35ismmc.png

Offline

 

#3 2013-03-22 12:57:48

KonceptZer0
New Scratcher
Registered: 2013-03-22
Posts: 3

Re: Bouncing ball behaving erraticaly. Teleports around the screen on hit.

I'm using this:

when I receive [start]
forever if <touching [Right]>
  point in direction <(direction) - [180]>
  move [2] steps
  turn clockwise <pick random [-50] to [50]> degrees 
end

Offline

 

#4 2013-03-22 13:15:47

ErnieParke
Scratcher
Registered: 2010-12-03
Posts: 1000+

Re: Bouncing ball behaving erraticaly. Teleports around the screen on hit.

KonceptZer0 wrote:

I'm using this:

when I receive [start]
forever if <touching [Right]>
  point in direction <(direction) - [180]>
  move [2] steps
  turn clockwise <pick random [-50] to [50]> degrees 
end

That should be working, so now I'm assuming it's the center of your ball. You can always check it by going into edit the ball's costume, then by clicking on the + below the pallet of colors.

With regards,

ErnieParke


http://i46.tinypic.com/35ismmc.png

Offline

 

#5 2013-03-22 13:26:33

KonceptZer0
New Scratcher
Registered: 2013-03-22
Posts: 3

Re: Bouncing ball behaving erraticaly. Teleports around the screen on hit.

ErnieParke wrote:

KonceptZer0 wrote:

I'm using this:

when I receive [start]
forever if <touching [Right]>
  point in direction <(direction) - [180]>
  move [2] steps
  turn clockwise <pick random [-50] to [50]> degrees 
end

That should be working, so now I'm assuming it's the center of your ball. You can always check it by going into edit the ball's costume, then by clicking on the + below the pallet of colors.

With regards,

ErnieParke

YES! That just solved pretty much all the problems I was having. (It's the first time I'm using Scratch, I wasn't even aware of the center's existance and importance) Thank you very much!

Offline

 

Board footer