Touching Sprite not working for me

1,950 views
Skip to first unread message

Madeline Bishop

unread,
Jun 21, 2013, 2:35:33 PM6/21/13
to creative-comp...@googlegroups.com
Please advise.

My project: http://scratch.mit.edu/projects/11005107/

I want the ball to disappear when Gobo touches it.  

Alan Yorinks

unread,
Jun 21, 2013, 3:21:49 PM6/21/13
to creative-comp...@googlegroups.com
This was a tough one. There is a conflict between the glide instruction in the previous instruction. It is a timing issue that I don't fully comprehend. I have remixed your project here http://scratch.mit.edu/projects/11008891/

Look at the soccer ball code, to see my changes.

Hope this helps.

Alan

Alan Yorinks

unread,
Jun 21, 2013, 3:56:15 PM6/21/13
to creative-comp...@googlegroups.com
Got another remix: http://scratch.mit.edu/projects/11009331/. In this one I put your original code back but added some trace variables to help understand how the code was working. If you watch the values of the traces, trace1 is not incremented meaning the touch is not detected. 

The problem is the length of time for the glide. If you hold the mouse down and move gobo over the ball for 10 seconds, the touch will be detected. So the timer for the glide seems to be a blocking call. That is, nothing else is happening during that 10 second period. Since the glide is reinvoked with each loop iteration, there is a very small window of opportunity for the touch detection to occur.

That was kind of fun (at least for me) and hopefully not too stressful for you.

Alan

Madeline Bishop

unread,
Jun 21, 2013, 4:32:40 PM6/21/13
to creative-comp...@googlegroups.com
Thank you so much for the help.  I was going crazy! I am re-thinking the game so I can finish it today.

Alan Yorinks

unread,
Jun 21, 2013, 5:36:20 PM6/21/13
to creative-comp...@googlegroups.com
My pleasure. 

Reply all
Reply to author
Forward
0 new messages