How fast am i sliding my finger?
DanielA
Member Posts: 101
Hello everyone i was wondering if there was a way to check how fast i slide my finger across the screen. If it goes slow then its 20 or less if it goes fast then 20-60 depending on how fast superfast 60+. Please this would be a great help to me.. thanks everyone
Comments
counter, touchX, touchY..
set these when the mouse is down or a touch event happens, then increase the counter every say 0.1 seconds
then when touch/mouse is released, get the magnitude (length) of the distance between the two points (see here http://gamesalad.com/wiki/interface_reference:expression_editor) and get the value of the counter
your strength would then be equal to the magnitude divided by the counter value
eg if the user moves his finger 200 pixels in 1 seconds that's a strength of 200
if the user moves his finger 250 pixels in 0.5 seconds, that's a strength of 500
that's how i'd do it anyway... don't know if it's the best way
@jmp909 this is what i want to happen.. Put ur finger on a actor called "left" (left is constrained to your finger) now slide ur finger as fast as u can to hit an actor called "right" and see how far "right" will fly.. im really confused about how i would do this kinda thing..
Thanks BadAsApps