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

#1 2009-05-17 15:18:16

Kingdaro
Scratcher
Registered: 2008-06-08
Posts: 100+

Bounce Script?

I need a script that makes a ball bounce off the bottom of the stage, and the bottom only, which I will be using a giant line for the bottom. I can't put "if touching edge" in it, because it has a gravity script and I want it to be realistic. It has to say "if touching bottom". Help?

Offline

 

#2 2009-05-17 15:20:31

bosox397
Scratcher
Registered: 2008-02-17
Posts: 1000+

Re: Bounce Script?

My newest project is called bounce. It has the exact scripting you want. just look at the script for the ball, and change the if touching? to  the name of ur sprite

LINK: http://scratch.mit.edu/projects/bosox397/500244

Last edited by bosox397 (2009-05-17 15:21:27)


Dear Scratch Users,
I'm done with scratch, or at least making projects. I have made one last big game, thats both fun and teaches a lesson about water. It'd mean a lot if you gave me feedback.                              http://scratch.mit.edu/projects/bosox397/569201

Offline

 

#3 2009-05-17 15:24:54

Kingdaro
Scratcher
Registered: 2008-06-08
Posts: 100+

Re: Bounce Script?

Thanks! (Wow that was quick!)

Offline

 

#4 2009-05-17 15:27:43

bosox397
Scratcher
Registered: 2008-02-17
Posts: 1000+

Re: Bounce Script?

yeah well u basically asked for something i made already so yah


Dear Scratch Users,
I'm done with scratch, or at least making projects. I have made one last big game, thats both fun and teaches a lesson about water. It'd mean a lot if you gave me feedback.                              http://scratch.mit.edu/projects/bosox397/569201

Offline

 

#5 2009-05-17 23:51:19

yambanshee
Scratcher
Registered: 2007-11-06
Posts: 500+

Re: Bounce Script?

http://scratch.mit.edu/projects/yambanshee/371970 might help you as well.

Offline

 

#6 2009-05-19 12:54:59

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

Re: Bounce Script?

Here's a way to do it without using extra sprites:

<if><( <y position> <<> -165?(depends how big the ball is) )><if>using directions<point in direction( (( 180 <->  <direction>))<if>using velocities<set{ Y velocity }to( <{ (( <{Y velocity  }> <*> -1 )) }>

Offline

 

Board footer