How do I move to target location with touch controls...

Get help using Construct 2

Post » Sun Aug 10, 2014 7:20 pm

I have a side scrolling game which has a hero on screen which moves left or right based on X position of touch.x vs hero.x

The issue I have is the player only moves when touch is active. I would like to touch once and move to destination without using pathfinding. Any suggestions?
You do not have the required permissions to view the files attached to this post.
B
15
S
4
Posts: 31
Reputation: 1,267

Post » Sun Aug 10, 2014 10:34 pm

If you're not opposed to using 3rd party plugins
You do not have the required permissions to view the files attached to this post.
B
24
S
9
G
4
Posts: 1,646
Reputation: 6,596

Post » Mon Aug 11, 2014 6:37 am

How about a walkLeft variable on the object. eg assign 10 on it to walk left 10 whatever units. -10 for right whatever units, 0 = stop.
And on every tick or every 0.x seconds, move and increment 1 unit back to 0.

Change is in touch to on touched any.
B
32
S
7
G
2
Posts: 317
Reputation: 2,851

Post » Mon Aug 11, 2014 6:56 am

on touch create a sprite

if sprite.x > player.x - player simulate platform pressing right
I told my dentist I had trouble with my teeth and asked her to fix it without looking in my mouth..
B
54
S
16
G
8
Posts: 6,160
Reputation: 19,775


Return to How do I....?

Who is online

Users browsing this forum: No registered users and 29 guests