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

#1 2008-01-21 00:15:35

MITscratcher
Scratcher
Registered: 2007-09-16
Posts: 100+

Another glitch

In one of my older games, I have a script that makes a sprite play a sound if touching mouse pointer. Although, when the sprite is set to hide, it still plays the sound if "touching" (Supposedly) the mouse pointer. In the game that I am making now, this is a very important question in which I NEED an answer.

Last edited by MITscratcher (2008-01-21 00:16:21)


http://scratch.mit.edu/projects/MITscratcher/235497
                    ^ My NEW Snake Game! ^

Offline

 

#2 2008-01-21 03:39:06

Paddle2See
Scratch Team
Registered: 2007-10-27
Posts: 1000+

Re: Another glitch

So the question is "Does a hidden sprite generate a Touching Mouse Pointer event?"


http://i39.tinypic.com/2nav6o7.gif

Offline

 

#3 2008-01-21 12:25:30

MITscratcher
Scratcher
Registered: 2007-09-16
Posts: 100+

Re: Another glitch

Paddle2See wrote:

So the question is "Does a hidden sprite generate a Touching Mouse Pointer event?"

Exactly, I may be hard with wording sometimes . . .  smile


http://scratch.mit.edu/projects/MITscratcher/235497
                    ^ My NEW Snake Game! ^

Offline

 

#4 2008-01-21 13:02:06

kevin_karplus
Scratcher
Registered: 2007-04-27
Posts: 1000+

Re: Another glitch

I wrote a short script to test this:

when greenflag clicked
   hide
   forever if touching mouse-pointer
        play sound pop


Sure enough, the "touching mouse-pointer" test can be true even if the sprite is hidden.

Putting in a second sprite, and testing if touching sprite2 shows that a hidden sprite does not test "touching sprite2".  This seems inconsistent.  Either hidden sprites should always test if touching, or never test if touching.

Scratch team—what is the *intended* behavior for hidden sprites?

Note, in both cases the test was done by the hidden sprite.

Offline

 

#5 2008-01-21 13:08:04

MITscratcher
Scratcher
Registered: 2007-09-16
Posts: 100+

Re: Another glitch

kevin_karplus wrote:

I wrote a short script to test this:

when greenflag clicked
   hide
   forever if touching mouse-pointer
        play sound pop


Sure enough, the "touching mouse-pointer" test can be true even if the sprite is hidden.

Putting in a second sprite, and testing if touching sprite2 shows that a hidden sprite does not test "touching sprite2".  This seems inconsistent.  Either hidden sprites should always test if touching, or never test if touching.

Scratch team—what is the *intended* behavior for hidden sprites?

Note, in both cases the test was done by the hidden sprite.

It would also be nice for an idea to sense whether or not a sprite is showing, or not. Otherwise, there really is no way to support a hidden sprite to do something based on the idea of being hidden.


http://scratch.mit.edu/projects/MITscratcher/235497
                    ^ My NEW Snake Game! ^

Offline

 

#6 2008-01-21 15:28:01

Paddle2See
Scratch Team
Registered: 2007-10-27
Posts: 1000+

Re: Another glitch

Are these findings true for both the Scratch and Java environments.  Or just one or the other?


http://i39.tinypic.com/2nav6o7.gif

Offline

 

#7 2008-01-21 20:52:25

kevin_karplus
Scratcher
Registered: 2007-04-27
Posts: 1000+

Re: Another glitch

I only tested in Squeak.

Offline

 

#8 2008-01-21 20:54:41

MITscratcher
Scratcher
Registered: 2007-09-16
Posts: 100+

Re: Another glitch

Is there an alternative way to avoid this glitch?


http://scratch.mit.edu/projects/MITscratcher/235497
                    ^ My NEW Snake Game! ^

Offline

 

#9 2008-01-22 04:08:15

Paddle2See
Scratch Team
Registered: 2007-10-27
Posts: 1000+

Re: Another glitch

There may be...I just tried to replicate Kevin's results in 1.2.1 (which is what I am running) and was not able to do so.  I seem to recall some mention of a bug like this being fixed in 1.2.1.  What version are you running?


http://i39.tinypic.com/2nav6o7.gif

Offline

 

#10 2008-01-22 07:58:51

kevin_karplus
Scratcher
Registered: 2007-04-27
Posts: 1000+

Re: Another glitch

I was running v1.2.1 on Mac OS 10.3.9

Offline

 

#11 2008-01-22 12:30:10

Paddle2See
Scratch Team
Registered: 2007-10-27
Posts: 1000+

Re: Another glitch

Hmmm.  I'm running on Vista Home Premium (sounds like a beer!).  Maybe the glitch is OS dependent?  Should we fire off an e-mail to the team?


http://i39.tinypic.com/2nav6o7.gif

Offline

 

Board footer