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

#1 2008-07-14 00:19:26

Bluestribute
Scratcher
Registered: 2008-01-24
Posts: 1000+

Rebound

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


http://img247.imageshack.us/img247/1204/bluestributett4.jpg
That's my PSN ID. I know tons of COD4 glitches. Add me as your friend. Oh, and get a headset

Offline

 

#2 2008-07-14 00:36:26

F18
Scratcher
Registered: 2008-07-08
Posts: 16

Re: Rebound

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

 

#3 2008-07-14 00:44:10

Bluestribute
Scratcher
Registered: 2008-01-24
Posts: 1000+

Re: Rebound

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?


http://img247.imageshack.us/img247/1204/bluestributett4.jpg
That's my PSN ID. I know tons of COD4 glitches. Add me as your friend. Oh, and get a headset

Offline

 

#4 2008-07-14 01:09:34

newareagle
Scratcher
Registered: 2008-06-10
Posts: 100+

Re: Rebound

Yup that should work. Good luck  tongue


My Guitar Hero Game.
8/9 Projects on the Front Page at Once!

Offline

 

#5 2008-07-14 01:44:47

Bluestribute
Scratcher
Registered: 2008-01-24
Posts: 1000+

Re: Rebound

Yeah um, it's not working  sad


http://img247.imageshack.us/img247/1204/bluestributett4.jpg
That's my PSN ID. I know tons of COD4 glitches. Add me as your friend. Oh, and get a headset

Offline

 

#6 2008-07-14 01:52:53

deatheater
Scratcher
Registered: 2008-04-11
Posts: 1000+

Re: Rebound

u could manipulate this http://scratch.mit.edu/projects/deatheater/208471

Offline

 

#7 2008-07-14 02:00:28

Bluestribute
Scratcher
Registered: 2008-01-24
Posts: 1000+

Re: Rebound

deatheater wrote:

u could manipulate this http://scratch.mit.edu/projects/deatheater/208471

That's not really what I am looking for though


http://img247.imageshack.us/img247/1204/bluestributett4.jpg
That's my PSN ID. I know tons of COD4 glitches. Add me as your friend. Oh, and get a headset

Offline

 

#8 2008-07-14 02:54:15

deatheater
Scratcher
Registered: 2008-04-11
Posts: 1000+

Re: Rebound

http://scratch.mit.edu/projects/deatheater/213736 , hope that helps  smile

Last edited by deatheater (2008-07-14 02:55:11)

Offline

 

#9 2008-07-14 05:42:27

Llamalover
Scratcher
Registered: 2007-05-18
Posts: 100+

Re: Rebound

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!


Be nice, I'm an old lady  wink

Offline

 

#10 2008-07-14 12:36:49

Bluestribute
Scratcher
Registered: 2008-01-24
Posts: 1000+

Re: Rebound

deatheater, I haven't tried dissecting your project yet, but it doesn't seem to work  sad  as in, yours has the same problem as mine" it won't go down


http://img247.imageshack.us/img247/1204/bluestributett4.jpg
That's my PSN ID. I know tons of COD4 glitches. Add me as your friend. Oh, and get a headset

Offline

 

#11 2008-07-14 17:22:36

deatheater
Scratcher
Registered: 2008-04-11
Posts: 1000+

Re: Rebound

what do u mean, it works for me?

Offline

 

#12 2008-07-14 17:24:37

archmage
Scratcher
Registered: 2007-05-18
Posts: 1000+

Re: Rebound

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.


Hi, I am Archmage coder extraordinaire. I do Scratch,pascal,java,php,html, AS2 and AS3. Leave me a message if you want coding advice. Also check out my personal website, lots of good stuff about web development, Flash, and Scratch (v1 and v2) !

Offline

 

#13 2008-07-14 17:33:20

Bluestribute
Scratcher
Registered: 2008-01-24
Posts: 1000+

Re: Rebound

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?


http://img247.imageshack.us/img247/1204/bluestributett4.jpg
That's my PSN ID. I know tons of COD4 glitches. Add me as your friend. Oh, and get a headset

Offline

 

#14 2008-07-14 18:05:35

archmage
Scratcher
Registered: 2007-05-18
Posts: 1000+

Re: Rebound

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 ))


Hi, I am Archmage coder extraordinaire. I do Scratch,pascal,java,php,html, AS2 and AS3. Leave me a message if you want coding advice. Also check out my personal website, lots of good stuff about web development, Flash, and Scratch (v1 and v2) !

Offline

 

#15 2008-07-14 18:14:05

Bluestribute
Scratcher
Registered: 2008-01-24
Posts: 1000+

Re: Rebound

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)


http://img247.imageshack.us/img247/1204/bluestributett4.jpg
That's my PSN ID. I know tons of COD4 glitches. Add me as your friend. Oh, and get a headset

Offline

 

#16 2008-07-14 18:50:04

deatheater
Scratcher
Registered: 2008-04-11
Posts: 1000+

Re: Rebound

<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  smile

Offline

 

#17 2008-07-15 04:24:40

Llamalover
Scratcher
Registered: 2007-05-18
Posts: 100+

Re: Rebound

Look at my project called 'Bounce' : that'll help you.


Be nice, I'm an old lady  wink

Offline

 

Board footer