Home Tutorials Download Beta Store Forum Documentation KnowledgeBase Wiki Blog

ShiVa3D

Return to Apple iPhone/iPad/iPod

swipe an object out of the screen

iOS Development and xCode questions

swipe an object out of the screen

Postby d4dhanuj » 27 Feb 2012, 12:25

Hi friends I am making an game in which many object will be moving in my screen ( like mouse hunt ) i have to select them and through it out of the screen and the object should move in which direction I am moving my finger.

Can any one tell me how i should get the direction in which rest of the movement should be made.
d4dhanuj
Fresh Boarder
Fresh Boarder
 
Posts: 18

Re: swipe an object out of the screen

Postby capiright » 27 Feb 2012, 19:20

1. On the initial touch set that point as your origin
2. Track the movement and when you pass a certain distance from your origin you can make it your direction vector (p1 - p0)
User avatar
capiright
Platinum Boarder
Platinum Boarder
 
Posts: 518


Return to Apple iPhone/iPad/iPod

cron