Im playing with a platform idea and am wanting to do a simple touch swipe. If i swipe up, i want the character to jump and play the jump animation.
What is the best way to do something like this ?
A simple explanation or capx would be very much appreciated.
<img src="smileys/smiley1.gif" border="0" align="middle" />
Here is how I do it.
<img src="http://content.screencast.com/users/ArcadEd/folders/Jing/media/ea9688d9-2e7d-4068-9596-56a8cd7acb28/2014-01-29_2356.png" border="0" />
Replace the function calls with your events.
You might want to add a distance check so that the smallest 1pixel movement won't cause a function. Also I would suggest comparing against the X values to see which is greater. If you want to say move right, but because you have 1 px difference for Y you will jump anyways.
Develop games in your browser. Powerful, performant & highly capable.
ArcadEd, thank you so much for showing me an example its great and helped me to understand the process.
Jayderyu, thats a really great idea, I will implement the distance check so I dont have any problems.
Both of you have been really helpful, thanks again guys
<img src="smileys/smiley20.gif" border="0" align="middle" />