How do I make car movement based on touch

0 favourites
  • 4 posts
From the Asset Store
Hand-animated Sprite Base for isometric game/animation development
  • Greetings

    I have been trying to make my player move towards the touch coords with the car movement but have been unbelievable unsuccessful. I tried a while loop to make the player rotate using car simulate control towards the angle of player.x, player.y, touch.x, touch.y and that basically broke my game as it got unresponsive.

    Any help greatly appreciated,

    Thanks!

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • try every tick condition instead of while loop. while loop does things in a single frame, and it never finishes in your case

    if car movement is not required, try this: scirra.com/tutorials/129/mousemoves-following-the-cursor

  • How about something like if player.x != touch.x && touch.x != 0: set Vector X to ___

    And same for Y. It doesn't need to be on a loop even. But if the car is supposed to automatically come to a stop upon lifting the finger then you would need to add the inverted version of the above then: set Vector X to 0.

  • Thank you very much for the replies. I shall try what you suggested tomorrow. About the mouse moves following the cursor, that cannot work I'm sorry as I am using Touch

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)