Discuss Scratch

theonlygusti
Scratcher
1000+ posts

How to arrange layers correctly?

https://scratch.mit.edu/projects/201364430/

Try pressing the ‘s’ key.

The head moves down behind the body.

How do I make the head stay in front of the body?
PowerSnatch
Scratcher
100+ posts

How to arrange layers correctly?

Change 50 to 27 on sprite “sanic head”. This is the most back (is that the right word?) you can go and stay in front of the body. 28 layers doesn't work. I assume this is a bug in Scratch right now.

Last edited by PowerSnatch (Feb. 3, 2018 21:54:42)

theonlygusti
Scratcher
1000+ posts

How to arrange layers correctly?

PowerSnatch wrote:

go back (27) layers

Change 50 to 27 on sprite “sanic head”. This is the most back (is that the right word?) you can go and stay in front of the body. 28 layers doesn't work. I assume this is a bug in Scratch right now.
Are there only 27 layers in scratch?
PowerSnatch
Scratcher
100+ posts

How to arrange layers correctly?

I don't think so.

(Let's say I create 2 sprites named “sprite1” & “sprite2”)

I remember setting “sprite1” at 900 layers back:
forever
go to front
go back (1000) layers
end

Then setting sprite2 at 890 layers:
forever
go to front
go back (890) layers
end

“sprite2” was behind “sprite1”.

So I tried setting sprite2 back 500 layers, and then 100 layers:
forever
go to front
go back (500) layers
end

forever
go to front
go back (100) layers
end

“sprite2” was still behind “sprite1”.

So then I took out the “go to front” & “go back () layers” out of the forever loop and placed it before the forever loop and it works no problem. It seems like Scratch doesn't like these two blocks in a forever loop.

I made a project to clarify what I'm talking about: Layer Bug in v459.1
mstone326
Scratcher
1000+ posts

How to arrange layers correctly?

If you only need the head in front then use the go to front block for that sprite.

No need to have go to front , go back 100 layers in a forever loop. Start with the top layer and move every one back by 1 appropriately
deck26
Scratcher
1000+ posts

How to arrange layers correctly?

I've always assumed the number of layers depends on the number of objects. If you have 4 objects there's no difference between going back 4 layers and going back 900 layers - you'll still be the backmost layer.

In @PowerSnatch's glitch demo it's therefore really about the timing of the forever loops. Whichever block runs first with a high value will put that sprite to the rear but the next block to run will put that sprite behind the first even if the number is lower. So not a glitch at all.

Of course this is just my view of things and I may be wrong.

Powered by DjangoBB