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

#1 2011-07-11 01:26:39

scimonster
Community Moderator
Registered: 2010-06-13
Posts: 1000+

Layer sensing with no modification?

I'm working on a game — Solitaire — and I need some help sensing the layer.
The <touching [mouse-pointer]?> isn't really doing what I need, because it is regardless of layer.

I'm working on dragging the cards, using that technique, but I only want it to go if the one above it is moving or if it is being clicked.
Each sprite has a private variable — moving? — which is set to 1 if it is moving — if it is being dragged or <([moving?] of (sprite above me)) = [1]>
(Sprite above me is also a local variable each has; that's working already.)

How do I only say that it is being dragged itself if it is in the top of the card — i.e, checking if it is the lower layer being touched? (They are on top of each other going down.  wink )

Credit will be given.

Last edited by scimonster (2011-07-11 01:26:49)

Offline

 

#2 2011-07-11 08:02:07

Taneb
Scratcher
Registered: 2009-07-07
Posts: 100+

Re: Layer sensing with no modification?

The easiest way would to give them all a variable "layer" and whenever the layer changes, also change this variable

Offline

 

#3 2011-07-11 09:56:32

scimonster
Community Moderator
Registered: 2010-06-13
Posts: 1000+

Re: Layer sensing with no modification?

Taneb wrote:

The easiest way would to give them all a variable "layer" and whenever the layer changes, also change this variable

I'll try that...

Offline

 

Board footer