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

#1 2012-07-19 14:13:46

LifeLaster
Scratcher
Registered: 2011-03-10
Posts: 51

Set Layer Script

I want a script that makes it so you can set a sprite to a specific layer, because in the project I'm working on "Blue Blob RPG", the battle system requires both enemy and player sprites to be on the same layer, or else the enemy just goes right through the sword.

This script should be like: [Set layer to (example number)].


Please read this until the end, because at some point, you will get a clue on the mystery, what mystery you may ask? Well, you will find the answer in the beginning, if you miss it, read it again, maybe you will find my treasure, who knows, it's hidden in the middle, you wanna know where in the middle it is? Check the end.

Offline

 

#2 2012-07-19 14:29:43

maxdoss
Scratcher
Registered: 2010-07-27
Posts: 1000+

Re: Set Layer Script

You can do that. You could use the

go back (number) layers

Last edited by maxdoss (2012-07-19 14:29:56)


It's my birthday. Deal with it.

Offline

 

#3 2012-07-19 14:36:25

LS97
Scratcher
Registered: 2009-06-14
Posts: 1000+

Re: Set Layer Script

You can use a simple workaround,

go to front
go back (number) layers
for an exact layer.

However, remember that two sprites can never be on the exact same layer and that layers anyway do NOT affect collisions!  smile

Offline

 

#4 2012-07-19 18:03:13

Appletini
New Scratcher
Registered: 2012-07-18
Posts: 23

Re: Set Layer Script

LS97 wrote:

You can use a simple workaround,

go to front
go back (number) layers
for an exact layer.

What about initialization issues? I support.

Offline

 

#5 2012-07-20 08:16:19

Chrischb
Scratcher
Registered: 2008-07-24
Posts: 1000+

Re: Set Layer Script

Appletini wrote:

LS97 wrote:

You can use a simple workaround,

go to front
go back (number) layers
for an exact layer.

What about initialization issues? I support.

Like when the project starts and then it's like all the scripts start at the same time except that some would have to start first causing the others to follow afterwards and judge their layers according to the new setup?  tongue  Agreed, lol

Sounds useful to me xD

Last edited by Chrischb (2012-07-20 08:16:41)


I fall: It's a tragedy. You fall: It's comedy.
Hmph enjoy your fall - I get a lovely spring... without pans of new leaves.

Offline

 

Board footer