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

#1 2009-08-27 13:04:57

RHY3756547
Scratcher
Registered: 2009-08-15
Posts: 1000+

Help Needed - Massive uncontrollable Lag, solution?

Hey.
I just published a game right there that only lags a bit in turbo speed offline and it lags so much you could rip your eyes out it's so jittery. Can someone look at the code and tell me if there's any way to optimize this?

Project:
http://scratch.mit.edu/projects/RHY3756547/661455

Thanks,
RHY3756547

Offline

 

#2 2009-08-27 15:19:54

golfer3
Scratcher
Registered: 2008-11-02
Posts: 1000+

Re: Help Needed - Massive uncontrollable Lag, solution?

maybe try getting rid of that contant music thing, it may make it lag a little bit more.

Offline

 

#3 2009-08-27 16:03:11

greenflash
Scratcher
Registered: 2009-05-27
Posts: 1000+

Re: Help Needed - Massive uncontrollable Lag, solution?

Sometimes too many of these can lag it:
[blocks]
<when green flag clicked>
<forever>
<end>
[/blocks]
try combining scripts if possible!


http://i48.tinypic.com/2wrkirk.pnghttp://i46.tinypic.com/6r5zk7.pnghttp://i45.tinypic.com/2vtxr1t.png

Offline

 

#4 2009-08-27 16:22:00

Mozaz
Scratcher
Registered: 2009-05-19
Posts: 500+

Re: Help Needed - Massive uncontrollable Lag, solution?

I'll have a look at it for you  smile

Well, I can see that you are using a lot of sprites to create on 3D looking sprite. This is nice, but you are using the same sprite in all of the seperate sprites. You should have the main script for the whole sprite in one sprite, and then just have scripts to make the other sprites go to the main sprite and point in it's direction.

That should make it better.  smile

Last edited by Mozaz (2009-08-27 16:25:24)


http://i33.tinypic.com/15i5fmp.png

Offline

 

#5 2009-08-28 02:16:57

RHY3756547
Scratcher
Registered: 2009-08-15
Posts: 1000+

Re: Help Needed - Massive uncontrollable Lag, solution?

Mozaz wrote:

I'll have a look at it for you  smile

Well, I can see that you are using a lot of sprites to create on 3D looking sprite. This is nice, but you are using the same sprite in all of the seperate sprites. You should have the main script for the whole sprite in one sprite, and then just have scripts to make the other sprites go to the main sprite and point in it's direction.

That should make it better.  smile

That's basically what I'm doing ATM, but the sprites all need layering code too. Maybe I could combine it with the movement code for less scripts?

Anyway - my point of blame is probably the fact that 50% of the sprites are ghosted - is there any way to optimize that?

Offline

 

#6 2009-08-28 06:21:54

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

Re: Help Needed - Massive uncontrollable Lag, solution?

You could try hiding them.

Offline

 

Board footer