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

#26 2008-02-18 20:16:48

kevin_karplus
Scratcher
Registered: 2007-04-27
Posts: 1000+

Re: Speeding projects up and reducing memory usage

Mayhem, in most programming languages, mod does only work on integers, so the result is an integer, but scratch does the right thing, defining  x mod y as
    x - y*floor(x/y)

Offline

 

#27 2009-05-22 14:30:04

Dudeson
Scratcher
Registered: 2009-05-07
Posts: 25

Re: Speeding projects up and reducing memory usage

What happens if you put all programs for each object wich are in a forever block, into just one? will that optimize the project?? for example:
[blocks]<when green flag clicked>
<forever>
<play sound[
<if><mouse down?>
<pen down>
<end>
<end>[/blocks]

instead of:
[blocks]
<when green flag clicked>
<forever>
<play sound[
<end>
<when green flag clicked>
<forever>
<if><mouse down?>
<pen down>
<end>
<end>
[/blocks]

Last edited by Dudeson (2009-05-22 14:34:09)

Offline

 

#28 2009-05-23 08:35:24

Dudeson
Scratcher
Registered: 2009-05-07
Posts: 25

Re: Speeding projects up and reducing memory usage

cmon! someone! please help!

Offline

 

#29 2009-05-23 08:42:50

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

Re: Speeding projects up and reducing memory usage

Dudeson wrote:

cmon! someone! please help!

Well, generally the "play sound" block will delay the project until the sound is finished. I think.
Yes, it would usually work.

Offline

 

#30 2009-05-23 10:03:11

MyRedNeptune
Community Moderator
Registered: 2007-05-07
Posts: 1000+

Re: Speeding projects up and reducing memory usage

Dudeson, yes, those scripts will have the same effect...

Coolstuff: no, only
              [blocks]<play sound[ whatever ]and wait>[/blocks] will delay the script,

while
[blocks]<play sound[ whatever ] >[/blocks] will not.


http://i52.tinypic.com/5es7t0.png I know what you're thinking! "Neptune! Get rid of those filthy advertisements and give us back the Zarathustra siggy, you horrible person!" Well, don't worry about it, the Zara siggy will be back soon, new and improved! ^^ Meanwhile, just do what the sig tells you to. >.>

Offline

 

#31 2009-05-23 15:26:26

Dudeson
Scratcher
Registered: 2009-05-07
Posts: 25

Re: Speeding projects up and reducing memory usage

MyRedNeptune wrote:

Dudeson, yes, those scripts will have the same effect...

Coolstuff: no, only
              [blocks]<play sound[ whatever ]and wait>[/blocks] will delay the script,

while
[blocks]<play sound[ whatever ] >[/blocks] will not.

thx for the help!

Offline

 

Board footer