Character moving left to right

Get help using Construct 2

Post » Wed Jul 06, 2016 1:04 pm

Well, your code does exactly what it is supposed to do.
It takes a X as target and will move your object until it reached that destination.

What you are wanting is far simpler.
You want, on click, to change the direction of the object.

So by default have it going in a direction.
On touch, change the value of the direction.

The object is now moving the other direction.

It gives :
Image

When dir is = 0, move the object to the right.
When dir is = 1, move the object to the left.

On touch, modify the value of dir so that it is either 0 or 1.
New to Construct ? Where to start

Image Image

Image Image

Please attach a capx to any help request or bug report !
Moderator
B
292
S
115
G
96
Posts: 7,293
Reputation: 70,769

Post » Wed Jul 06, 2016 6:30 pm

Kyatric wrote:Well, your code does exactly what it is supposed to do.
It takes a X as target and will move your object until it reached that destination.

What you are wanting is far simpler.
You want, on click, to change the direction of the object.

So by default have it going in a direction.
On touch, change the value of the direction.

The object is now moving the other direction.

It gives :
Image

When dir is = 0, move the object to the right.
When dir is = 1, move the object to the left.

On touch, modify the value of dir so that it is either 0 or 1.



thanks a lot bro you really help me there you don't even know man thanks a lot really an truly :mrgreen: :mrgreen:
B
14
S
7
G
3
Posts: 6
Reputation: 2,712

Previous

Return to How do I....?

Who is online

Users browsing this forum: MassimoF and 24 guests