How fast am i sliding my finger?

DanielADanielA Member Posts: 101
edited November -1 in Working with GS (Mac)
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

  • jmp909jmp909 Member Posts: 73
    i'd add these variables

    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
  • synthesissynthesis Member Posts: 1,693
    That's what she said (va-voomp-tishhhh!)
  • DanielADanielA Member Posts: 101
    kk well im learning a lot right know..
    @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
  • DanielADanielA Member Posts: 101
    synthesis said:
    That's what she said (va-voomp-tishhhh!)

    hahaha!
Sign In or Register to comment.