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

#1 2009-07-08 09:14:37

DaveyJJ
Scratcher
Registered: 2007-07-16
Posts: 5

Fully "inside" an object sensing possible?

A quick newbie question .... I see we can identify when one object is touching another object based on, say colour. But is there a method of saying something like "if this object is fully inside that object?"

I'm primarily thinking of odd boundary shapes ... I need to be able to sense when one shape is fully contained within a larger shape. Without using colour however.

Offline

 

#2 2009-07-08 09:23:37

The-Whiz
Scratcher
Registered: 2007-07-09
Posts: 1000+

Re: Fully "inside" an object sensing possible?

Hm... I would think so... Try this:

Have a large sprite and a small sprite and a sprite that covers the whole screen.

The "cover" is at 100% ghost effect and is at the very front...

The small sprite is a layer behind the large one, so if the small sprite is completely behind the large sprite, it won't be touching the cover. You can then make the cover sense this : <touching {small} ?> and if it is true do one thing and if it is false do another.

Offline

 

#3 2009-07-08 10:00:51

DaveyJJ
Scratcher
Registered: 2007-07-16
Posts: 5

Re: Fully "inside" an object sensing possible?

Understand. But the small sprite has to visually show up on top of the large one. I;m thinking of something like playing pieces n a board. I suppose I could add another ghosted  layer of the larger "piece" so that the layers would be, from top to bottom ...

cover (transparent)
background area copy (transparent)
small piece
background area

Does that make sense?

Offline

 

#4 2009-07-08 10:04:58

The-Whiz
Scratcher
Registered: 2007-07-09
Posts: 1000+

Re: Fully "inside" an object sensing possible?

Yeah... That sounds good... like the cover has a ghost effect, and a copy of the large sprite is at 100% ghost effect above the pieces?

Offline

 

#5 2009-07-08 10:54:06

DaveyJJ
Scratcher
Registered: 2007-07-16
Posts: 5

Re: Fully "inside" an object sensing possible?

Yes, that's right. I will post a screen shot later (when I get home from work).

Offline

 

Board footer