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

#1 2011-04-19 15:04:16

JT5
New Scratcher
Registered: 2011-04-17
Posts: 10

More scripts; more lag?

Sorry about this n00b-ie question, but if you had more scripts would your project run slower, because I was wondering whether scratch runs different scripts simultaneously, or do scripts run one after another?

So, for example,  if I had a script that was like:

When green flag clicked:
forever {
    change scrollx by (velocity*-1)
    set terrainNo to (round(scrollx/-480))
    switch to costume(terrainNo)
    set x to (scrollx+(480*terrainNo))
}

Would that run slower than if I had each line separate in their own forever loop?

Offline

 

#2 2011-04-19 18:51:04

silvershine
Scratcher
Registered: 2010-11-21
Posts: 500+

Re: More scripts; more lag?

Scratch can run scripts simultaneously, but the more scripts you have, and the longer they are, the slower the projects will be.

Offline

 

#3 2011-04-19 18:52:36

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

Re: More scripts; more lag?

I am not sure how it works exactly but I know for sure that if you have really long scripts that are not split up the editor will have massive lag.


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

 

#4 2011-04-19 19:04:59

Harakou
Community Moderator
Registered: 2009-10-11
Posts: 1000+

Re: More scripts; more lag?

archmage wrote:

I am not sure how it works exactly but I know for sure that if you have really long scripts that are not split up the editor will have massive lag.

But that's lag in the rendering of the scripts, not the actual running of the project.


http://www.blocks.scratchr.org/API.php?action=random&return=image&link1=http://i.imgur.com/OZn2RD3.png&link2=http://i.imgur.com/duzaGTB.png&link3=http://i.imgur.com/CrDGvvZ.png&link4=http://i.imgur.com/POEpQyZ.png&link5=http://i.imgur.com/ZKJF8ac.png

Offline

 

#5 2011-04-20 16:34:16

MoreGamesNow
Scratcher
Registered: 2009-10-12
Posts: 1000+

Re: More scripts; more lag?

Also, I'd guess that all the scripts, in letter-form behind the scenes, are all part of one giant for-loop.  I don't have any evidence to back this up; it is just a guess.


http://images2.layoutsparks.com/1/218929/rubiks-cube-animated-rotating.gif
"Cogito ergo sum" --  I think, therefore I am

Offline

 

#6 2011-04-20 16:47:06

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

Re: More scripts; more lag?

Harakou wrote:

archmage wrote:

I am not sure how it works exactly but I know for sure that if you have really long scripts that are not split up the editor will have massive lag.

But that's lag in the rendering of the scripts, not the actual running of the project.

Yeah, from my experience, it doesn't really matter if scripts are split up or not, they will run at the same speed. Split up scripts are better since they don't lag in the editor.


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

 

#7 2011-05-21 09:35:54

AlwaysForgotten
Scratcher
Registered: 2011-03-14
Posts: 1

Re: More scripts; more lag?

I've used tons of scripts, but none of my projects turn out slower.. Then again I use things like
<move(  )steps><when[  ]key pressed><when[  ]clicked><wait(  )secsc><forever><repeat( <broadcast[ <when I receive[

Offline

 

Board footer