Pages: 1
Topic closed
I haven't been able to get a sprite to slowly move *completely* off the Stage.
For example:
Goch's latest project - http://scratch.mit.edu/projects/goch/803008 - has two black curtains that move aside to open the project, then move back to close it. Each curtain covers half the Stage = 240 pixels wide. The center of the costume for each curtain is at the 120 pixel midpoint of the sprite.
Goch uses a Glide block to move each curtain. One says "Glide in 4 seconds to x = -342" And here's what happens: the curtain moves to the left until only 20 pixels of its width remain, then it stops. Goch uses Ghosting to remove that last vertical strip of curtain.
So I made a ball (pixel width only 72), placed it in the center of the Stage and Glided it leftward toward x = -342 just the way goch did. And the ball moved left until *20 pixels of it were left* and it stopped!
My own recent project "Sunrise" allowed the small Sun to rise until (probably) 20 pixels of it were left.....and it stopped.
Why do all these sprites (some large and some small) refuse to glide (or move) completely out of sight? Even if the leftward glide is increased from x = -342 to x = -360 the sprite stops 20 pixels short!
What am I missing here??
Offline
This is scratch's way of saving you from yourself. It doesn't trust you to move the sprites out of site because you may lose them. It could also be something else but I am pretty sure that is the reason.
Last edited by archmage (2009-12-14 21:29:26)
Offline
archmage wrote:
This is scratch's way of saving you from yourself. It doesn't trust you to move the sprites out of site because you may lose them. It could also be something else but I am pretty sure that is the reason.
That seems unlikely considering could just click on it in the sprite bank and, using blocks, make it go to (0,0).
Offline
archmage wrote:
This is scratch's way of saving you from yourself. It doesn't trust you to move the sprites out of site because you may lose them. It could also be something else but I am pretty sure that is the reason.
This is why we need a camera...
Offline
cocoanut wrote:
archmage wrote:
This is scratch's way of saving you from yourself. It doesn't trust you to move the sprites out of site because you may lose them. It could also be something else but I am pretty sure that is the reason.
That seems unlikely considering could just click on it in the sprite bank and, using blocks, make it go to (0,0).
Right... I don't understand why you can't slide it off the Stage.
Offline
JSO wrote:
It's extremely annoying that a certain percentage of the sprite is always visible on the screen, it makes scrolling games look bad
![]()
Luckily, you don't have to worry when you do scrolling with two sprites.
Offline
2 answers...
1) I found it to be 18 pixels when testing. I made a border (tried it solid black and textured) that was 18 pixels wide, like a frame around the screen. Worked like a charm. Black version even looked like the black background one on pc.
2) Make your sprite with an 18 pixel-wide transparent border. Then the part that remains on the screen is invisible.
Again, you may want to check that 18 pixel amount yourself. I did it by drawing a small square with a color-coded diagonal line (looks like steps when zoomed in.) I made this into a sprite, moved it as far off the screen as it would go, matched the visible colors of the diagonal line to a zoomed-in picture of the sprite and counted the visible pixels. I also checked this technique on different sized sprites and found it to be generally consistent. You can see a visible version of the border technique (#1) in action in my Random Dungeon Generator scroller here (where it is used to hide the movement of the 4 large background sprites as they move off the stage)...
http://scratch.mit.edu/projects/Locomule/708768
Offline
Topic closed
Pages: 1