How do you make an action happen when you slide your finger onto a sprite?

Hi there! I'm trying to make a game for blind people. Right now as a test, I'm making the device vibrate when the person slides their finger onto a square sprite.

So the user would start with their finger down at any point on the canvas, then would slide their finger across the screen without lifting it up. When it is anywhere within the boundary of the square, the device should vibrate continuously.

I've half-managed it using the 'draggedAnySprite' property, but it continues vibrating even when I drag my finger out of the square. Could anyone kindly let me know where I'm going wrong? Thank you!!

Screenshot 2022-05-10 1832134

Stop the sound/vibrate when x,y is not over the sprite

Try this old project I once did as an experiment for a blind quiet clock ...
http://ai2.appinventor.mit.edu/?galleryId=5853955980263424

Thank you very much for this!

Wow, this project is awesome and exactly what I'm looking for. It helped solve some other problems I was having too :blush:

In case some one else might find it useful as an example, here are the details of the sample blind quiet clock ...
Capture

blind_quiet_clock.aia (6.9 KB)


(Yes, I did not need to have that draw_circle call inside the ball loop. Hindsight is 20/20 - ABG)


I'm a big fan of value procedures.
to balls result
to center_x result
to center_y result
draw_circle draws the black clock face. In retrospect, it should be called draw_clock_face.

hh_degrees relies on there being 12 hour marks on the clock face, 360 degrees total, so each hour gets 360/12 = 30 degrees.

mm_degrees relies on there being 60 minute marks on the clock face, 360 degrees total, so each minute gets 360/60 = 6 degrees.

To move a ball, we need to translate from polar coordinates to px,py coordinates.

R is the radius of the clock face.

About:
This is a simulation of a silent watch for blind operation. Try to tell the time by slowly dragging your finger across the watch face. It is rigged to vibrate when you cross a hand or travel outside the watch face.

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.