Does anyone have a script to help me make something come to a stop? What i mean is, it uses velocity to go, but as it goes up, I want it to slow down, and as it goes down, I want it to speed up, but eventually it will come to a stop, basically like sending a skateboard down a half pipe: It goes up, comes back, but not as far, than keeps on doing that until it stops
Offline
Make it so:
When Green flag Clicked
Forever
if velocity>0
repeat until velocity<0
change velocity by -x
if velocity<0
repeat until velocity)0
change velocity by x
If you want you could add:
if velocity is > -.5 and < then .5
set velocity to 0
(To make it stop completely)
Hope this helps!
Offline
Alright, I might try it tonight but definitely tomorrow Now I will make it blocks (for me)
<when green flag clicked>
<forever>
<if><( <{ speed }> <>> 0 )>
<repeat until><( <{ speed }> <<> 0 )>
<change{ speed }by( -X?
<if><( <{ speed }> <<> 0 )>
<repeat until><( <{ speed }> <>> 0 )>?
<change{ speed }by( X?
Offline
Yup that should work. Good luck
Offline
Yeah um, it's not working
Offline
u could manipulate this http://scratch.mit.edu/projects/deatheater/208471
Offline
deatheater wrote:
u could manipulate this http://scratch.mit.edu/projects/deatheater/208471
That's not really what I am looking for though
Offline
http://scratch.mit.edu/projects/deatheater/213736 , hope that helps
Last edited by deatheater (2008-07-14 02:55:11)
Offline
I had a project which would have really helped you, but thanks to cosmic rays/ a virus, I lost everything on E:, where all my scratch stuff was... Give me a couple of minutes and I'll see if I can make a quick project to help!
Offline
deatheater, I haven't tried dissecting your project yet, but it doesn't seem to work as in, yours has the same problem as mine" it won't go down
Offline
what do u mean, it works for me?
Offline
Bluestribute wrote:
Alright, I might try it tonight but definitely tomorrow Now I will make it blocks (for me)
<when green flag clicked>
<forever>
<if><( <{ speed }> <>> 0 )>
<repeat until><( <{ speed }> <<> 0 )>
<change{ speed }by( -X?
<if><( <{ speed }> <<> 0 )>
<repeat until><( <{ speed }> <>> 0 )>?
<change{ speed }by( X?
All that is unnessary. Just set the number to itself times a number that is less than 1 and greater than 0.
Offline
archmage wrote:
Bluestribute wrote:
Alright, I might try it tonight but definitely tomorrow Now I will make it blocks (for me)
<when green flag clicked>
<forever>
<if><( <{ speed }> <>> 0 )>
<repeat until><( <{ speed }> <<> 0 )>
<change{ speed }by( -X?
<if><( <{ speed }> <<> 0 )>
<repeat until><( <{ speed }> <>> 0 )>?
<change{ speed }by( X?All that is unnessary. Just set the number to itself times a number that is less than 1 and greater than 0.
What? I don't really understand. Do you mean X*.15 and X*2? Where X is speed?
Offline
Bluestribute wrote:
archmage wrote:
Bluestribute wrote:
Alright, I might try it tonight but definitely tomorrow Now I will make it blocks (for me)
<when green flag clicked>
<forever>
<if><( <{ speed }> <>> 0 )>
<repeat until><( <{ speed }> <<> 0 )>
<change{ speed }by( -X?
<if><( <{ speed }> <<> 0 )>
<repeat until><( <{ speed }> <>> 0 )>?
<change{ speed }by( X?All that is unnessary. Just set the number to itself times a number that is less than 1 and greater than 0.
What? I don't really understand. Do you mean X*.15 and X*2? Where X is speed?
I mean this.
<set{ speed }to( (( <{ speed }> <*> 0.9 ))
Offline
archmage wrote:
Bluestribute wrote:
archmage wrote:
All that is unnessary. Just set the number to itself times a number that is less than 1 and greater than 0.What? I don't really understand. Do you mean X*.15 and X*2? Where X is speed?
I mean this.
<set{ speed }to( (( <{ speed }> <*> 0.9 ))
But that doesn't speed it up. I need it to speed up and slow down like the half pipe (look at first post)
Offline
<when green flag clicked>
<forever>
<if> <( <abs( <direction> <<> 90 )>
<change{ speed }by( -1
<else>
<if><< <not> <abs( <( <direction> <=> 90 )> >>
<change{ speed }by( 1
<end>
<end>
<set{ speed }to( (( <{ speed }> <*> 0.9 ))
<end>
hope I helped
Offline
Look at my project called 'Bounce' : that'll help you.
Offline