How do I make car movement based on touch

Get help using Construct 2

Post » Sun Jul 20, 2014 4:16 pm

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!
Black Bobby The Hole Greenlit with 303 votes.
B
35
S
8
G
1
Posts: 163
Reputation: 2,979

Post » Sun Jul 20, 2014 7:29 pm

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
B
3
Posts: 5
Reputation: 181

Post » Sun Jul 20, 2014 8:08 pm

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.
B
5
S
1
Posts: 31
Reputation: 439

Post » Mon Jul 21, 2014 12:21 am

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 :)
Black Bobby The Hole Greenlit with 303 votes.
B
35
S
8
G
1
Posts: 163
Reputation: 2,979


Return to How do I....?

Who is online

Users browsing this forum: No registered users and 8 guests