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

#1 2010-08-21 10:23:57

gtoal
Scratcher
Registered: 2010-08-15
Posts: 26

How do I select which layer I'm drawing on?

For my second scratch project I'm putting together a pacman-like maze game, but I've hit a problem I could do with some advice over: rather than have hundreds of sprites for the dots that pacman eats, I've just included the dots in the maze layer, and I want to draw over them in black as the pacman traverses the maze.  Unfortunately the maze isn't on the backmost stage (because I need another hidden layer below it), and so the painting to black is happening on a layer that's obscured by several other layers.

Is there a way to force which layer is updated when you paint?

(I have another fairly minor issue with this game, which I'll ask in a separate posting)

The game is nearly done; it's very cleanly written and would make a good example for people to copy from, to create their own pacman derivatives, but I don't want to post it until I fix the two most annoying problems.  (Also as a separate issue I'm waiting for copyright clearance to use someone's image that I borrowed).  I don't mind emailing it to individuals in the meantime though.

Thanks,


Graham

Offline

 

#2 2010-08-21 10:30:58

coolstuff
Community Moderator
Registered: 2008-03-06
Posts: 1000+

Re: How do I select which layer I'm drawing on?

Unfortunately, it's not possible to use the pen on any layer other than the background. It's been suggested a lot that that be changed - and it probably will be in the future - but you'll just have to come up with some sort of a workaround for the time being.

Offline

 

#3 2010-08-21 10:33:16

samurai768
Scratcher
Registered: 2009-07-21
Posts: 1000+

Re: How do I select which layer I'm drawing on?

Sorry, but pen and stamp always draw on the backmost stage. You could, however, draw the pellets on the backmost stage . Then use the pen over them. I hope this helped  smile

(If you haven't noticed already, I love saying backmost. Backmost! Backmost!)

Gah! Ninja'd again xD

Last edited by samurai768 (2010-08-21 10:33:36)

Offline

 

#4 2010-08-21 11:23:47

gtoal
Scratcher
Registered: 2010-08-15
Posts: 26

Re: How do I select which layer I'm drawing on?

samurai768 wrote:

Sorry, but pen and stamp always draw on the backmost stage. You could, however, draw the pellets on the backmost stage . Then use the pen over them. I hope this helped  smile

(If you haven't noticed already, I love saying backmost. Backmost! Backmost!)

Gah! Ninja'd again xD

I can't.  There's another layer has to be on top of the stage.  (It's a mask that's used to determine the allowed paths through the maze)  I can't make the mask layer invisible because the test for sprites touching only works if the layer is visible, right?
(otherwise I'd hide it and paint the maze on the stage instead of its own layer, and all would be well)

Back to the drawing board!  I may just say "hang the elegance" and go with the brute-force solution of several hundred hand-placed sprites :-(  (unless the overhead of having them all watch for an overlap with another sprite is too excessive)

Thanks for the suggestions, everyone.

G

Offline

 

Board footer