Moving actor in the opposite direction of the touch
Hunnenkoenig
Member Posts: 1,173
I have absolutely no idea, how I could realise that. Maybe somebody can give me a tip.
I want to move an actor exactly in the opposite direction, as the player moves his finger.
It is for the wall breaker game and I want to move the racket the other direction as it would normally move.
My self.position.X is constrained and I have set it to a min/max to stop at the frame of the screen.
A move behaviour is not the option, I think. It should be some scripting, but I don't know, how to acomplish that.
Any help would be appreciated :-)
I want to move an actor exactly in the opposite direction, as the player moves his finger.
It is for the wall breaker game and I want to move the racket the other direction as it would normally move.
My self.position.X is constrained and I have set it to a min/max to stop at the frame of the screen.
A move behaviour is not the option, I think. It should be some scripting, but I don't know, how to acomplish that.
Any help would be appreciated :-)
Comments
Rule
if mouse is down,
move to touch 1postion x and touch 1 position y
at a negative speed so -100
download project from here:
http://gamesalad.com/game/play/44586
Although it is mouse down, that should work fine on the iphone as well
hopefull won't be affected by the other thing you have going on already.
It is not exactly what I wanted though.
Normally I have the mouse position X constrained to the actor's position X, so you can pull the actor back and forth and it moves with the mouse (your finger).
Now I need exactly the same ting, but in the opposite direction. If I move my finger to the right, the actor moves to the left, but exactly as much as my finger moves.
So if I move my finger 1cm to the right, the actor moves 1cm to the left.
scene_width - mouse or touch position's x
Should reverse the movement, or at least it does in my head
I will try and report back.
Sorry for screaming, but you made me very happy!