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

#1 2010-08-06 06:28:24

colorfusion
Scratcher
Registered: 2009-10-03
Posts: 500+

Is there any way to get a <Touching [stage]> Block?

I really need it for a project, and only just realised it is not there.
I really don't see why they didn't put stage in it.

Offline

 

#2 2010-08-06 07:28:14

climber59
Scratcher
Registered: 2009-12-15
Posts: 100+

Re: Is there any way to get a <Touching [stage]> Block?

When isn't a sprite touching the stage though?


Check out my projects if you have a chance.

Offline

 

#3 2010-08-06 07:34:23

colorfusion
Scratcher
Registered: 2009-10-03
Posts: 500+

Re: Is there any way to get a <Touching [stage]> Block?

climber59 wrote:

When isn't a sprite touching the stage though?

When it is on top of another sprite or stamp.

Offline

 

#4 2010-08-06 07:53:31

laser100
Scratcher
Registered: 2009-12-04
Posts: 100+

Re: Is there any way to get a <Touching [stage]> Block?

Well a stamp is on a stage, so it's technically the stage. But for sprite part, I have never thought of that.

Offline

 

#5 2010-08-06 07:55:38

colorfusion
Scratcher
Registered: 2009-10-03
Posts: 500+

Re: Is there any way to get a <Touching [stage]> Block?

Even if there is a way to get <Touching stamp> or <Touching stamp of [___]> I would be able to do it.
I have found a way around it but it is extremely glitchy and limits the background to a plain colour.

Offline

 

#6 2010-08-06 08:59:28

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

Re: Is there any way to get a <Touching [stage]> Block?

I don't think there's any easy way to do that, as far as I know...

Offline

 

#7 2010-08-06 12:27:16

Wolfie1996
Retired Community Moderator
Registered: 2009-07-08
Posts: 1000+

Re: Is there any way to get a <Touching [stage]> Block?

You could try putting a "Touching sprite" block on the stage... it could only work online, though  hmm  Even then, I'm not totally sure if it would work...


"...Jargon - the practice of never calling a spade a spade, when you might instead call it a manual earth-restructing implement..." - Bill Bryson, Mother Tongue

Offline

 

#8 2010-08-06 12:50:06

colorfusion
Scratcher
Registered: 2009-10-03
Posts: 500+

Re: Is there any way to get a <Touching [stage]> Block?

Wolfie1996 wrote:

You could try putting a "Touching sprite" block on the stage... it could only work online, though  hmm  Even then, I'm not totally sure if it would work...

It just give out "Error!"

Offline

 

#9 2010-08-06 12:52:47

Sunrise-Moon
Scratcher
Registered: 2009-06-27
Posts: 1000+

Re: Is there any way to get a <Touching [stage]> Block?

Make the stage a certain color?


http://i1067.photobucket.com/albums/u427/HulKDzN/RebornBlade.png

Offline

 

#10 2010-08-06 13:24:51

antimonyarsenide
Scratcher
Registered: 2010-02-03
Posts: 1000+

Re: Is there any way to get a <Touching [stage]> Block?

Problem: Stamps, once they're down, don't have their position recorded. So that won't be possible. I think you'll have to go with some complex variable/sprite oriented stuff then. Or use color sensors on the stage.


http://myfastcounter.com/count.php?c_style=75&amp;id=1284314427
No, I'm not back (yet  tongue ), so pretend this is invisible.

Offline

 

#11 2010-08-06 13:27:18

AtomicBawm3
Scratcher
Registered: 2009-06-27
Posts: 1000+

Re: Is there any way to get a <Touching [stage]> Block?

You could make an invisible sprite the size of the stage with the same looks as the stage and use that for sensing, but stamps can't really be sensed very well.  What exactly are you stamping?


http://i50.tinypic.com/j0yw0p.jpg

Offline

 

#12 2010-08-06 14:25:52

colorfusion
Scratcher
Registered: 2009-10-03
Posts: 500+

Re: Is there any way to get a <Touching [stage]> Block?

AtomicBawm3 wrote:

You could make an invisible sprite the size of the stage with the same looks as the stage and use that for sensing, but stamps can't really be sensed very well.  What exactly are you stamping?

Stamps are the mario tiles, take a look at my newest project, link down in sig.
Since mario could not sense stamps as they are all different colours I was hoping I could make it so I could do sensors and when not touching stage.

Right now I am doing when not touching colour of stage, but it means the stage has to be one colour and sprites must avoid that colour.

Offline

 

#13 2010-08-06 14:37:44

fg123
Scratcher
Registered: 2008-11-13
Posts: 1000+

Re: Is there any way to get a <Touching [stage]> Block?

No. When a sprite is on top of another sprite, it is still touching the stage.


Hai.

Offline

 

#14 2010-08-06 14:42:17

colorfusion
Scratcher
Registered: 2009-10-03
Posts: 500+

Re: Is there any way to get a <Touching [stage]> Block?

fg123 wrote:

No. When a sprite is on top of another sprite, it is still touching the stage.

Really?
If it works like that, They need to change it.
Its like having a ham sandwich, the 2 bits of bread do not touch each other because the ham is in the middle, unless the ham is smaller than the bread.

Offline

 

#15 2010-08-06 15:13:56

antimonyarsenide
Scratcher
Registered: 2010-02-03
Posts: 1000+

Re: Is there any way to get a <Touching [stage]> Block?

colorfusion wrote:

fg123 wrote:

No. When a sprite is on top of another sprite, it is still touching the stage.

Really?
If it works like that, They need to change it.
Its like having a ham sandwich, the 2 bits of bread do not touch each other because the ham is in the middle, unless the ham is smaller than the bread.

Color contact has to be visible, but sprite contact doesn't. That's what makes hidden sprites able to sense if they're touching something.


http://myfastcounter.com/count.php?c_style=75&amp;id=1284314427
No, I'm not back (yet  tongue ), so pretend this is invisible.

Offline

 

#16 2010-08-06 16:50:35

AtomicBawm3
Scratcher
Registered: 2009-06-27
Posts: 1000+

Re: Is there any way to get a <Touching [stage]> Block?

I got it!  But it's difficult.  Have a list that gets added to when they click.  Have it set that point to your costume number.  Then, have your Mario sprite be above it's center of rotation.  Using the x and y positions, round them to some decimal that makes it accurate enough. Then make the if list ask if where it is is a 1 on the list.  It will work, I've used it before.


http://i50.tinypic.com/j0yw0p.jpg

Offline

 

#17 2010-08-06 18:10:44

Harakou
Community Moderator
Registered: 2009-10-11
Posts: 1000+

Re: Is there any way to get a <Touching [stage]> Block?

So from what I understand, you just want to know if a sprite is touching the stage? Then why not make a white sprite the size of the entire stage, set the ghost effect to 99, and make it go to the very back layer? Then use If <touching sprite _ > If would be nearly identical to If <touching stage>


http://www.blocks.scratchr.org/API.php?action=random&amp;return=image&amp;link1=http://i.imgur.com/OZn2RD3.png&amp;link2=http://i.imgur.com/duzaGTB.png&amp;link3=http://i.imgur.com/CrDGvvZ.png&amp;link4=http://i.imgur.com/POEpQyZ.png&amp;link5=http://i.imgur.com/ZKJF8ac.png

Offline

 

Board footer