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)
Offline
So the question is "Does a hidden sprite generate a Touching Mouse Pointer event?"
Offline
Paddle2See wrote:
So the question is "Does a hidden sprite generate a Touching Mouse Pointer event?"
Exactly, I may be hard with wording sometimes . . .
Offline
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
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.
Offline
Are these findings true for both the Scratch and Java environments. Or just one or the other?
Offline
I only tested in Squeak.
Offline
Is there an alternative way to avoid this glitch?
Offline
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?
Offline
I was running v1.2.1 on Mac OS 10.3.9
Offline
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?
Offline