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

#1 2010-01-15 22:27:55

Cookies100
Scratcher
Registered: 2008-10-18
Posts: 74

Falling and Rising Without Bouncing.

I have these two scripts:

<when green flag clicked>
<forever>
<if><touching color[ terrain color
<change y by( 1

and

<when green flag clicked>
<forever>
<if><<  <not>  >><touching color[ terrain color
<change y by( -2

I don't want the irritating bouncing, so how can I get rid of it?


http://t2.gstatic.com/images?q=tbn:cSea35x5Aa93LM:http://scratch.mit.edu/static/icons/buddy/172660_sm.png%3Ft%3D2009-11-18%2B20%253A59%253A44
Fear the Cookie.  hmm

Offline

 

#2 2010-01-16 03:45:29

juststickman
Scratcher
Registered: 2009-05-31
Posts: 1000+

Re: Falling and Rising Without Bouncing.

You can use Yvelocity, if you want an explanation I'll post it. But with your method I think you could try:
<when[  ]clicked>
<forever>
<if><<  <not>  >><touching color[ (terrain color)
<change y by( -2
<else>
<change y by( 1
<if><<  <not>  >><touching color[ (terrain color)
<change y by( -1
<end>
<end>

EDITL ok, the if not touching colors turned out weird, but I know that it works (I just tried in scratch).

Last edited by juststickman (2010-01-16 03:46:04)


http://is.gd/iBQi2 Add grob to your sig and help with world dominiation!http://is.gd/iBQ9Q                                                             Hey guys, we're seriously naming our team bob?

Offline

 

#3 2010-01-16 16:37:36

Cookies100
Scratcher
Registered: 2008-10-18
Posts: 74

Re: Falling and Rising Without Bouncing.

juststickman wrote:

You can use Yvelocity, if you want an explanation I'll post it. But with your method I think you could try:
<when[  ]clicked>
<forever>
<if><<  <not>  >><touching color[ (terrain color)
<change y by( -2
<else>
<change y by( 1
<if><<  <not>  >><touching color[ (terrain color)
<change y by( -1
<end>
<end>

EDITL ok, the if not touching colors turned out weird, but I know that it works (I just tried in scratch).

It still bounces.


http://t2.gstatic.com/images?q=tbn:cSea35x5Aa93LM:http://scratch.mit.edu/static/icons/buddy/172660_sm.png%3Ft%3D2009-11-18%2B20%253A59%253A44
Fear the Cookie.  hmm

Offline

 

#4 2010-01-16 18:17:22

Wolfie1996
Retired Community Moderator
Registered: 2009-07-08
Posts: 1000+

Re: Falling and Rising Without Bouncing.

Try using a smaller number for the [if touching terrain] bit. Maybe 0.01 or something.


"...Jargon - the practice of never calling a spade a spade, when you might instead call it a manual earth-restructing implement..." - Bill Bryson, Mother Tongue

Offline

 

#5 2010-01-17 02:22:43

Cookies100
Scratcher
Registered: 2008-10-18
Posts: 74

Re: Falling and Rising Without Bouncing.

Wolfie1996 wrote:

Try using a smaller number for the [if touching terrain] bit. Maybe 0.01 or something.

It won't fall as fast though when it's jumping.


http://t2.gstatic.com/images?q=tbn:cSea35x5Aa93LM:http://scratch.mit.edu/static/icons/buddy/172660_sm.png%3Ft%3D2009-11-18%2B20%253A59%253A44
Fear the Cookie.  hmm

Offline

 

#6 2010-01-17 17:36:42

Wolfie1996
Retired Community Moderator
Registered: 2009-07-08
Posts: 1000+

Re: Falling and Rising Without Bouncing.

Cookies100 wrote:

Wolfie1996 wrote:

Try using a smaller number for the [if touching terrain] bit. Maybe 0.01 or something.

It won't fall as fast though when it's jumping.

Keep the number in the falling script the same, just change the going up one  smile  Sorry if that wasn't too clear.


"...Jargon - the practice of never calling a spade a spade, when you might instead call it a manual earth-restructing implement..." - Bill Bryson, Mother Tongue

Offline

 

#7 2010-02-16 23:21:40

sydney2000
Scratcher
Registered: 2009-11-29
Posts: 7

Re: Falling and Rising Without Bouncing.

try this:
blocks
<when green flag clicked>
<forever>
<if><key[ up arrow ]pressed?>
<set{ gravity }to( 15
<change y by( <{ gravity }>
<end>
<repeat until><touching color[ terrain color
<change{ gravity }by( -1
<change y by( <{ gravity }>
<end>
<end>
/blocks

Offline

 

Board footer