Touch to move

Get help using Construct 2

Post » Sun Jun 23, 2013 11:44 pm

Good day, people.
Something that may be apparently simple, but anyone got any idea on this?
I'm trying do something like this:

(pseudo-code)
touch the button;
object begins to move horizontally;

touch the button;
object stops moving;

What I'm tying to do does work with key down, mouse down or "is touching", but I want it to be:
touch to start moving and then touch to stop moving.

I tried doing this with 8-direction and platform
Any ideas? Thanks.
A sample capx is attached.

https://www.dropbox.com/s/uda716mvf6pb789/moveExample.capx

Thank you all again.
B
5
Posts: 8
Reputation: 295

Post » Mon Jun 24, 2013 6:58 am

You are nearly there already ^^
One thing to change only : don't set the bullet speed to 10, set it to (10-joe.Bullet.Speed).
This way, if you are already moving, you will stop, and if you are not moving, you will start :)
B
17
S
8
G
4
Posts: 461
Reputation: 6,077

Post » Mon Jun 24, 2013 8:52 am

Thank you. Thanks very much.
Truth be told, I continued working on it and the bullet method came to me. Originally, I couldn't get it moving at all. Checking the reply, I wondered what you meant, because my original post was this:

https://www.dropbox.com/s/uumuqta2imbhlwo/originalMoveExample.capx

My mistake? I was saving to my dropbox as I was working.

And thank you very much for the bullet speed tip.

Great.
B
5
Posts: 8
Reputation: 295

Post » Mon Jun 24, 2013 9:54 am

@KMOBridge
Hey again !

I worked on your dropbox link, and there was already the bullet behavior, yes.
You seemed to have some difficulties with the diferent controls though, and what you described could have been done with a lot of behaviors, like 8 directions, custom movements or bullet. I did all 3 in this example capx, with a menu to change the input type. Take a look at the event sheet to see how to use each controls well in you case.
If you have any questions, don't hesitate to ask !Guizmus2013-06-24 09:54:38
B
17
S
8
G
4
Posts: 461
Reputation: 6,077

Post » Sat Jun 29, 2013 2:37 am

@Guizmus:

Thanks, I'll have a look ar this, and get back to you.
B
5
Posts: 8
Reputation: 295

Post » Sat Jun 29, 2013 5:05 am

@Guizmus:

Just looked at your solutions.
Amazing.
Thank you.
I Had wondered about functions, but didn't know where to start.

Thank you ever so much.
B
5
Posts: 8
Reputation: 295


Return to How do I....?

Who is online

Users browsing this forum: LaurenceBedford, luckyrawatlucky, oddreal and 11 guests