Tracking finger to throw objects

MrSKYoneMrSKYone Member Posts: 26
edited July 2012 in Working with GS (Mac)
Hi to you all,

I would like to know if it is possible to throw object using finger tracking?
To illustrate what I ask, Flickkick football and paper toss apps are some good examples.
Of course, as these games are in 3D, I would like to know if we could do the same on a 2D plane.

I think it consists in tracking finger coordinates and ask gamesalad to make an actor follow the same angle and direction but Im a bit lost. I would like to reproduce angle and direction, with a velocity depending on the finger speed.

Any tips or comments about it would be welcome :)

Thanks!

Best Answers

  • RThurmanRThurman Posts: 2,881
    Accepted Answer
    The curve comes from gravity (or from acceleration downward).

    The 3D effect comes from slightly shrinking the actor's size as it travels. (Things that grow smaller seem to be traveling away from the eye.)
  • RThurmanRThurman Posts: 2,881
    Accepted Answer
    Instead of gravity use the 'Accelerate' behavior. Accelerate the actor downward (270) and it will simulate gravity. ( Accelerate is a persistent behavior and will continue to apply a downward force on the actor there after.)

    Use the 'Change Velocity' behavior to kick the actor up in the air. (Change velocity is an action and only happens for the moment that it's turned on.)

  • RThurmanRThurman Posts: 2,881
    Accepted Answer
    Glad its working for you. (Glad that there are great developers like @tshirtbooth who are generous with their projects/demos.)

Answers

  • MrSKYoneMrSKYone Member Posts: 26
    Ok, here I am

    I figured out how to build up the throw angle attribute
    (The user can touch and create is angle between the touch and release point anywhere on screen)

    Angle: VectorToAngle(ReleasePointX-TouchPointX,ReleasePointY-TouchPointY)
    Strength: Magnitude(ReleasePointX-TouchPointX,ReleasePointY-TouchPointY)

    Now I need to figure out how to make a behavior that will reproduce a curved finger swipe.
    I found some template but I can't download so I need to get textual information.
    Is there anybody who could help me find a way to do that? Please :)

    Thanks
  • MrSKYoneMrSKYone Member Posts: 26
    So, quick update.
    I finally found out a tutorial which explains how to draw a path a makes an actor follows it.
    Added to the Angle and strength attributes I previously created, It make something closer to what I need (without angle and strength, the actor just stop where the mouse stopped too)

    Once more, If you have anything to help I would be so happy haha I remain far from the curved swipe effect that we could find on flickkick football.

    PS: Im writing all of this down so others could eventually use it.
  • MrSKYoneMrSKYone Member Posts: 26
    Thanks Thurman!

    My problem with gravity is that my actor is at the center of my plan's height. I could make a rule reversing the gravity with angles but how to fix my actor so it doesn't fall with gravity?
  • MrSKYoneMrSKYone Member Posts: 26
    Great, Im going to try this. Thanks for your help !!! I'll tell you if it worked ;)
  • RThurmanRThurman Member, Sous Chef, PRO Posts: 2,881
    You might want to try TSB's project from this thread:
    http://forums.gamesalad.com/discussion/41961/-free-demos-from-tshirtbooth-happy-easter-#latest

    Study project 2.
  • MrSKYoneMrSKYone Member Posts: 26
    It worked great, so stupid I didn't find this out on my own haha.
    thanks a lot :)
Sign In or Register to comment.