Making Ball move

wongj19wongj19 Member Posts: 45

Ok firstly, how can I make my game so that I can change the direction I flick my ball but it moves at the same speed no matter how fast you flick the ball. the way I want to flick my ball is a touch and then a flick.

Secondly how can I use the interpolate function to gradually make my ball smaller so that it looks like the ball is travelling a distance.

Comments

  • KevinCrossKevinCross London, UKMember Posts: 1,894
    edited June 2016

    Just a theory but you might be able to track how quick the swipe action is by subtracting the time the swipe starts from the time the swipe ends using game.time. You could also store the start and end positions of the swipe to get the length of the swipe. And then do some hocus pocus with those numbers to get the strength and speed of the flick.

    Search the forums for distance between two points to calculate the length of the swipe.

    Touch is pressed and touch is released will give you the start and end actions to store time and positions.

  • wongj19wongj19 Member Posts: 45

    To get the direction of flick I know that you have to use:
    VectorToAngle(ReleasePointX-TouchPointX,ReleasePointY-TouchPointY)

    But how can I find release and touch points. Please help

  • KevinCrossKevinCross London, UKMember Posts: 1,894
    edited June 2016

    Not tried it but it looks like @Armelline has created a template to show how fast a user has swiped as well as the the distance of swipe:

    http://www.armelline.com/snippets.html (look for Swipe Factory on the page)

    There's also a cut down version of the template showing the disance of swipe here: http://forums.gamesalad.com/discussion/comment/490767/#Comment_490767

    Again not tried it.

    With all of this data you might be able to modify the "Change Velocity" code in this comment: http://forums.gamesalad.com/discussion/comment/390593/#Comment_390593

  • wongj19wongj19 Member Posts: 45

    Not tried it but it looks like @Armelline has created a template to show how fast a user has swiped as well as the the distance of swipe:

    http://www.armelline.com/snippets.html (look for Swipe Factory on the page)

    There's also a cut down version of the template showing the disance of swipe here: http://forums.gamesalad.com/discussion/comment/490767/#Comment_490767

    Again not tried it.

    With all of this data you might be able to modify the "Change Velocity" code in this comment: http://forums.gamesalad.com/discussion/comment/390593/#Comment_390593

    umm it's kinda hard to understand.
    I there is any easier demo that someone can make for me that would be amazing.

  • ArmellineArmelline Member, PRO Posts: 5,397

    Here's a quick adaptation of a similar thing I made a while back. It previously tied the ball speed to the flick speed, but this one does not.

  • wongj19wongj19 Member Posts: 45

    @Armelline said:
    Here's a quick adaptation of a similar thing I made a while back. It previously tied the ball speed to the flick speed, but this one does not.

    Thanks soooooo much!!!

Sign In or Register to comment.