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

#1 2009-12-14 20:55:38

Larry828
Scratcher
Registered: 2007-05-30
Posts: 100+

Sliding a sprite off the Stage -- completely?

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

 

#2 2009-12-14 21:28:24

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

Re: Sliding a sprite off the Stage -- completely?

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)


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

 

#3 2009-12-14 21:34:01

cocoanut
Scratcher
Registered: 2007-07-10
Posts: 1000+

Re: Sliding a sprite off the Stage -- completely?

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).


http://i42.tinypic.com/20gyvif.jpgPlease leave a message at the beep.
Steam: Hellephant

Offline

 

#4 2009-12-14 21:35:54

illusionist
Retired Community Moderator
Registered: 2008-07-02
Posts: 1000+

Re: Sliding a sprite off the Stage -- completely?

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...


http://i.imgur.com/8LX1NrV.png

Offline

 

#5 2009-12-14 21:36:55

Vista4563
Scratcher
Registered: 2009-07-20
Posts: 500+

Re: Sliding a sprite off the Stage -- completely?

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.


Team Vista | TBG Moderator | #stopKony #Kony2012 | http://ls.gd/icgrin http://is.gd/78GWUZ
http://is.gd/jEY5Ihttp://is.gd/Vl19zR http://i.imgur.com/L4HIs.png

Offline

 

#6 2009-12-15 05:13:55

JSO
Community Moderator
Registered: 2007-06-23
Posts: 1000+

Re: Sliding a sprite off the Stage -- completely?

It's extremely annoying that a certain percentage of the sprite is always visible on the screen, it makes scrolling games look bad  sad


http://oi48.tinypic.com/2v1q0e9.jpg

Offline

 

#7 2009-12-18 06:45:39

Seefat
Scratcher
Registered: 2009-11-19
Posts: 18

Re: Sliding a sprite off the Stage -- completely?

I Have the same problem while scrolling.

Offline

 

#8 2009-12-18 23:27:16

Jonathanpb
Scratcher
Registered: 2008-07-25
Posts: 1000+

Re: Sliding a sprite off the Stage -- completely?

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  sad

Luckily, you don't have to worry when you do scrolling with two sprites.  big_smile


"Human beings... must have action; and they will make it if they cannot find it.
-Charlotte Brontë

Offline

 

#9 2009-12-20 17:35:24

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

Re: Sliding a sprite off the Stage -- completely?

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


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

Offline

 

Board footer