Discuss Scratch

mwiedmann
Scratcher
100+ posts

Improved Scrolling Background How To - The ultimate scrolling background solution. New version.


Many of you have seen and used the scrolling background how to I posted recently. It works great but I've made a major improvement so I will be removing it soon. It has been replaced by…

Improved Scrolling Background How To

The concept and most of the code is basically the same, but the way clones are used to show the background images has been dramatically improved. I've also included some AI controlled sprites in this version so you can see how they work with the scrolling background.

The problem with most scrolling solutions you see is that they use 1 sprite for each image. If you have a large map this is just not feasible. My solution uses only 1 sprite. You just have to add your images. The trick is that the sprite creates clones of itself to display the background images. The new version reduces the number of clones required down to just a handful. It's now super efficient.

Let me know if you find any bugs or have any questions.
eastons
Scratcher
25 posts

Improved Scrolling Background How To - The ultimate scrolling background solution. New version.

Very awesome man! Been banging my head on this problem for a few hours.

Thanks,
eastons

Edit: I used a website imagesplitter.net to resize an image to 1920 by 1440(480x360 * 4)and cut it into 4x4 grid. The result was a really nice space background. http://scratch.mit.edu/projects/10679752/

Last edited by eastons (June 6, 2013 19:01:53)

eastons
Scratcher
25 posts

Improved Scrolling Background How To - The ultimate scrolling background solution. New version.

I still would like people to know how wonderful this project is. It has Tons of flexibility and is CRAZY fast. I think of this as one of scratches finest middleware solutions.

Eastons

Powered by DjangoBB