IOS screen
DreamLab
Member Posts: 2,127
I am making a game to where one object is in front of me, I do what I need to do with it, then swipe it off screen(and while it is going off screen, I want another actor to come on screen) and so on and so forth. Please help or point out a demo. I have been unable to find a demo and I've been stuck at this for a couple days. Thanks
DL
DL
Comments
DL
You can look at the vector that is created from the finger of the user:
If mouse is down then
change attribute game.startMouseX to mouse.x
change attribute game.startMouseY to mouse.y
otherwise
swipe = vectorToAngle(game.startMouseX-mouse.x, game.StartMouseY-mouse.y)
this will give you an angle, from 0 to 359 or 360 (can't remember now) where 0 if I'm not mistaken means -> right
so you do
if swipe > -45 and swipe < 45 then swipe is right
if swipe >=45 and <=135 then swipe is up
and so on.
DL
***I merged the topics. Makes more sense - QS ***