How to make the actor rotate and accelerate following touch position?

greedydadygreedydady Member Posts: 35
edited November -1 in Working with GS (Mac)
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!

Comments

  • forkliftforklift Member Posts: 386
    Maybe you can do something like:

    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
Sign In or Register to comment.