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

#1 2009-11-02 12:43:29

steppenwulf
Scratcher
Registered: 2009-07-23
Posts: 1000+

I need help with scrolling troubles

I am making a game that involves 4 way scrolling. The trouble is that, when you get near the border between two backround sprites, they don't stay exactly where they are supposed to. When this happens, they move slightly apart from each other, revealing the white background. Does anyone know a script I can use to avoid this?


I'm graduating HS this April and going to college in the Fall.

Offline

 

#2 2009-11-03 18:10:04

Locomule
Scratcher
Registered: 2009-08-24
Posts: 500+

Re: I need help with scrolling troubles

No but if you use a border, you can cover it up...
example 1) visible border...
http://scratch.mit.edu/projects/Locomule/708768

example 2) "invisible" border... (not really but appears so because is solid black)
http://scratch.mit.edu/projects/Locomule/742929

peace


aka Pain from DragonSpires, Delrith Online, BotBattle, Urban Dead etc etc lol

Offline

 

#3 2009-11-03 18:12:54

Ssbrawl700
Scratcher
Registered: 2009-02-11
Posts: 100+

Re: I need help with scrolling troubles

I 99.99% sure that when u do it in presentation mode that glitch won't happen


Can you beat the ever-so challenging Keyboard Khaos?

Offline

 

#4 2009-11-03 18:41:16

fg123
Scratcher
Registered: 2008-11-13
Posts: 1000+

Re: I need help with scrolling troubles

You could try instead of the 480 and the 360 numbers, lower them by 5 or so.


Hai.

Offline

 

#5 2009-11-04 21:22:42

Locomule
Scratcher
Registered: 2009-08-24
Posts: 500+

Re: I need help with scrolling troubles

Ssbrawl700, I think that steppenwulf is referring to something else. When I first encountered this problem (at the edges of the stage/screen,) I did some experimenting to figure out what was going on. This is from memory, but here is what I recall discovering...

If you try to make a sprite (big or small) move off the screen by moving off any side, It will stop just short of completely going away. The exact amount left on the screen is 18 pixels regardless of the sprite's size (although I didn't try a sprite smaller than 18 pixels.) As a side note, it now occurs to me that by leaving a transparent border of at least 18 pixels around a sprite, perhaps that will solve that problem ?!?! At any rate, that doesn't help with scrolling because this requires multiple sprites that must seam together on all four sides. No gaps.
So what happens is that as one of the sprites scrolls off the edge, instead of moving smoothly away, it stalls and then disappears when it gets down to those last 18 pixels. I like both of the fixes I originally listed. The border could easily be used as a background for stats, score, etc. Or if you prefer no border, using the solid black border gives the impression that there is no border.
Unfortunately (or in some ways fortunately?), my dial-up connection is so slow that I cannot check out someone else's application unless it is very small and I have a lot of free time. So my solutions are usually just whatever I can think of. So I would love to hear any alternate solutions to this problem if anyone has one?!?! At any rate, I hope that some of this helps you out steppenwulf.


aka Pain from DragonSpires, Delrith Online, BotBattle, Urban Dead etc etc lol

Offline

 

Board footer