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

#1 2011-09-28 19:38:53

eagleninja
Scratcher
Registered: 2010-08-10
Posts: 21

Scrolling glitch: Space between terrains

Ok, this has REALLY been bugging me, but the scrolling script I've been using leaves spaces between the terrains. When it scrolls onto the next terrain, the terrain repeatedly shudders back and forth.

Here's the basic script used I for the player:

[blocks]<when green flag clicked><forever><if><key[right arrow]pressed?><change{ scroll x }by( -1<if><key[right arrow]pressed?><change{ scroll x  }by( 1

Terrain script:<when green flag clicked><forever><go to x sad  scroll x + 480 * (terrain number) )y sad  0

Please help! sad

Offline

 

#2 2011-09-28 19:53:50

henley
Scratcher
Registered: 2008-06-21
Posts: 1000+

Re: Scrolling glitch: Space between terrains

This shouldn’t happen online or in presentation mode.

Try uploading a test and deleting it later.


"I've worked so hard for you and you give me nothing in return. Do you need help... Or do I?"

Offline

 

#3 2011-09-30 00:21:21

eagleninja
Scratcher
Registered: 2010-08-10
Posts: 21

Re: Scrolling glitch: Space between terrains

henley wrote:

This shouldn’t happen online or in presentation mode.

Try uploading a test and deleting it later.

The test did the same thing.  hmm

Offline

 

#4 2011-09-30 10:22:04

TinkerZone
New Scratcher
Registered: 2011-08-25
Posts: 10

Re: Scrolling glitch: Space between terrains

Could you provide your project so we could download and analyze it that way?

Offline

 

#5 2011-09-30 18:35:09

EdnaC
Scratcher
Registered: 2007-08-28
Posts: 100+

Re: Scrolling glitch: Space between terrains

Some scratchers put a black border on their scrollers to hide the "gaps".  I don't like giving up any screen space, so I use a couple of tricks:

Make terrains that overlap slightly (the edges from one to the next need to match).

Move the terrains "all at once" by using a broadcast.  In this project the "ship" does calculations based on velocity and thrust, then broadcasts "UpdateWorld" and then moves.  The other sprites move when they get this broadcast, keeping everything synchronized. 

Another approach (for some game ideas) is to use islands to show the movement.  These can be hidden when they go off-screen, and shown when they get "on screen" again.

Offline

 

#6 2011-10-03 20:24:20

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

Re: Scrolling glitch: Space between terrains

as for the border thing, Scratch automatically stops a sprite from moving off the screen while it is still showing 18 pixels worth of the image. The border shrinks the screen size but only by 18 pixels wide per side. With it, you can have sprites that disappear easily when scrolling off the screen. And it doesn't have to be black, you can make it decorative and/or use it to display player data without worrying about sprites moving into/through the nfo.

A cool technique is to make an 'invisible' (transparent) border around the sprite so you don't need the big screen border but you will have to do this in an outside graphics editor.


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

Offline

 

Board footer