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

#1 2010-05-22 01:21:19

ratchetruler
Scratcher
Registered: 2010-04-26
Posts: 2

need some help making script smaller

<when green flag clicked><forever><wait until><( <{ die }> <=> 1 )><change x by( -1<wait until><( <{ die }> <=> 1 )><change x by( -1<wait until><( <{ die }> <=> 1 )><change x by( -1
and it goes on
i need to shortern it!

Offline

 

#2 2010-05-22 02:23:47

Jonathanpb
Scratcher
Registered: 2008-07-25
Posts: 1000+

Re: need some help making script smaller

Are you talking about this?

[when green flag clicked)
[forever]
[][wait until <((die) = (1))>]
[][change x by (-1)]
[(end forever)]

If so, you could do this:

[when green flag clicked)
[forever if <((die) = (1))>]
[][change x by (-1)]
[(end forever if)]

I wouldn't do the last if I were you - I wouldn't use the forever if block, and it's silly to use that script instead of the first one. But do whatever you want.


"Human beings... must have action; and they will make it if they cannot find it.
-Charlotte Brontë

Offline

 

#3 2010-05-22 03:57:06

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

Re: need some help making script smaller

That's actually pretty short. Jonathan's way will cause some (0.001 seconds, but I care about that  tongue ) lag. Since you're doing the same thing, you could just have ONE wait until and then change.
when start clicked
forever
wait until <die = 1>
change x by (-1)
end forever


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

 

#4 2010-05-22 08:18:43

coolstuff
Community Moderator
Registered: 2008-03-06
Posts: 1000+

Re: need some help making script smaller

Both ways work impeccably well, though I prefer Jonathan's because, well, it what I would have done: I feel it's more programmable.

Offline

 

Board footer