Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

AppGameKit Classic Chat / Retrieving distance between touch points (swipes)

Author
Message
Aikiman
7
Years of Service
User Offline
Joined: 11th Apr 2017
Location:
Posted: 24th Aug 2017 01:56
Using the piece of code form this thread https://forum.thegamecreators.com/thread/195049 Im trying to print the dsitance between 2 points - press and release.
for some reason distanceX is not calculating the difference but instead touchEnd instead.

tmu
7
Years of Service
User Offline
Joined: 2nd Feb 2017
Location:
Posted: 24th Aug 2017 07:30 Edited at: 24th Aug 2017 07:31
seems to work for me?

PartTimeCoder
AGK Tool Maker
9
Years of Service
User Offline
Joined: 9th Mar 2015
Location: London UK
Posted: 24th Aug 2017 11:17 Edited at: 24th Aug 2017 11:33
Aikiman wrote: "Im trying to print the dsitance between 2 points"


Golelorn
7
Years of Service
User Offline
Joined: 20th Nov 2016
Location:
Posted: 24th Aug 2017 13:41 Edited at: 24th Aug 2017 13:42
In addition, here is a really good tutorial for AppGameKit mouse movement.

https://www.appgamekit.com/documentation/examples/sprites/8_move.htm
Aikiman
7
Years of Service
User Offline
Joined: 11th Apr 2017
Location:
Posted: 24th Aug 2017 20:51
Thanks guys, Ill take a look at your examples.
I guess ultimately what I am trying to do is be able to throw physics objects around the screen.

With the above code I have, my intentions are to use speed of the swipe (distance over time) as a physics force located around the start touch location.
Alternative;ly I thought about cheating and just creating an invisible kinematic body at touch location and move with the swipe thereby colliding with other objects as if there is a force there.

Any suggestions here?
fubarpk
Retired Moderator
19
Years of Service
User Offline
Joined: 11th Jan 2005
Playing: AGK is my friend
Posted: 28th Aug 2017 17:43
CJB gave me a lovely example of how to throw physics objects around with swiping your finger

https://forum.thegamecreators.com/thread/216065

fubar
Aikiman
7
Years of Service
User Offline
Joined: 11th Apr 2017
Location:
Posted: 30th Aug 2017 02:10
@fubarpk - looks and works great, thanks Ill see how I go with it!

Login to post a reply

Server time is: 2024-09-30 07:19:54
Your offset time is: 2024-09-30 07:19:54