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

#1 2008-05-25 13:10:41

mrguy740
Scratcher
Registered: 2008-01-25
Posts: 100+

Any way to make a scrolling game without lots of lag?

I have been looking at lots of scrolling games because I am interested in making one. But I have noticed that lots of the games are extremely slow is there any method of making one without too much lag?


The imagination exercises a powerful influence over every act of sense, thought, reason, over every idea. Latin Proverb

Offline

 

#2 2008-05-25 14:22:38

Mayhem
Scratcher
Registered: 2007-05-26
Posts: 1000+

Re: Any way to make a scrolling game without lots of lag?

Lag reduction methods:

Reduce the size of the screen you are using.
Make the scrolling sprite as "plain" as possible.

Having a scrolling sprite that is transparent, with only details on it reduces the amount of graphics work scratch needs to do.  EG, instead of a big black area with a few stars, have a big transparent area with a few stars and put it over a black background.

****

Also - run in presentation mode or online, as running from the scripting screen causes additionaly lag as scratch animates the scripts.


Web-spinning Spider:  http://scratch.mit.edu/projects/Mayhem/18456
3D Dungeon Adventure:  http://scratch.mit.edu/projects/Mayhem/23570
Starfighter X: http://scratch.mit.edu/projects/Mayhem/21825
Wandering Knight: http://scratch.mit.edu/projects/Mayhem/28484

Offline

 

#3 2008-05-25 16:05:30

mrguy740
Scratcher
Registered: 2008-01-25
Posts: 100+

Re: Any way to make a scrolling game without lots of lag?

thanks


The imagination exercises a powerful influence over every act of sense, thought, reason, over every idea. Latin Proverb

Offline

 

#4 2008-05-25 19:24:58

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

Re: Any way to make a scrolling game without lots of lag?

You can reduce the lag, but no matter what you do scrolling will take up a considerable about of your cpu unfortunately.


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

 

#5 2008-05-25 19:31:01

dingdong
Scratcher
Registered: 2007-08-09
Posts: 1000+

Re: Any way to make a scrolling game without lots of lag?

OK there's also sprite compression and script compression, sprite compression is where several sprites are made into one and use different costumes, but have different scroll variables, script compression is where you try deactivate as many scripts as possible when they are not needed, use variables and broadcasting to turn on and off scripts


http://img851.imageshack.us/img851/2829/superanbanner.png
click the image for my music

Offline

 

#6 2008-05-25 19:38:38

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

Re: Any way to make a scrolling game without lots of lag?

dingdong wrote:

OK there's also sprite compression and script compression, sprite compression is where several sprites are made into one and use different costumes, but have different scroll variables, script compression is where you try deactivate as many scripts as possible when they are not needed, use variables and broadcasting to turn on and off scripts

Your description of sprite compression is a bit sketchy. Perhaps you can provide an example?

Also for script compression. Try to put as much as you can into a single forever block. You should use variables when ever you need to but I would recommend not using too many broadcasts because it might make your code kind of messy. Also, take some time to look at your code to see if you did anything that was unnecessary and try to make it more efficient.


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

 

Board footer