How to make the actor rotate and accelerate following touch position?
greedydady
Member Posts: 35
Hi there,
i want to make a touch car racing game,as my topic said,
How to make the actor head rotate and accelerate following touch/mouse down position?
so that my car will turn to the way i want it to.
can any body help me?Thanks!
i want to make a touch car racing game,as my topic said,
How to make the actor head rotate and accelerate following touch/mouse down position?
so that my car will turn to the way i want it to.
can any body help me?Thanks!
Comments
two game level attributes (real) called "touchX" & "touchY"
in the touch actor (make it invisible)
Rule: when touch is pressed, constrain attribute game.touchX to self.position.X & constrain attribute game.touchY to self.position.Y
rule in car:
Accelerate toward game.touchX & game.touchY
rotate to game.touchX & game.touchY