How do I move object with finger touch

Get help using Construct 2

Post » Wed Apr 29, 2015 12:14 pm

Hi, everybody!

I'm studing how to build games with Construct 2, and I want to learn how I can move an object with a finger tap (mobile game), like Air Hockey, but only with the ball and nothing else,
I want to slide my finger in the screen, and when my finger hits the ball, it moves.
I know this will involve physical, because the faster I move your finger, the higher the speed of the ball. And when she hit the corners it should do angular motion.

I don't have any capx with this example, because I don't know how to beginning.

Please, help me! Thank you.
B
3
Posts: 6
Reputation: 187

Post » Wed Apr 29, 2015 4:21 pm

Create an object that will be the circle to hit the puck. Call it "Finger_Point" Give it solid behavior.

use the touch object like so:

Is in touch> Finger_Point> Set Position to Touch.X, Touch.Y.

Give the puck Bullet behavior and set it to bounce off objects.

If you want different speeds by hitting it, you'll have to use the physics behavior instead.
Image
B
75
S
23
G
3
Posts: 673
Reputation: 9,283

Post » Wed Apr 29, 2015 5:27 pm

Thank You, TheDom, I will try now.
B
3
Posts: 6
Reputation: 187

Post » Thu Apr 30, 2015 2:52 am

TheDom wrote:Create an object that will be the circle to hit the puck. Call it "Finger_Point" Give it solid behavior.

use the touch object like so:

Is in touch> Finger_Point> Set Position to Touch.X, Touch.Y.

Give the puck Bullet behavior and set it to bounce off objects.

If you want different speeds by hitting it, you'll have to use the physics behavior instead.


I used these settings as you said, and it worked. But I wanted a circle "invisible", ie just wanted the ball visible on the screen, without the disc.

Another question, when I add the bullet behavior to the object it moves alone when I start the project. How do I make it stop?
B
3
Posts: 6
Reputation: 187

Post » Thu Apr 30, 2015 6:56 am

set it's speed to 0
Image
B
75
S
23
G
3
Posts: 673
Reputation: 9,283

Post » Thu Apr 30, 2015 4:16 pm

TheDom wrote:set it's speed to 0


It was so obvious! duh :oops: Thanks again.

and only let the ball without the disc, you know how to do?
B
3
Posts: 6
Reputation: 187

Post » Thu Apr 30, 2015 10:13 pm

you still need the disc object. Just set it to invisible.
Image
B
75
S
23
G
3
Posts: 673
Reputation: 9,283

Post » Sat May 09, 2015 1:26 pm

Thanks, but It did not work as I would like
B
3
Posts: 6
Reputation: 187

Post » Sat May 09, 2015 5:32 pm

Could you be more specific about how it didn't work as you would like?
B
13
S
5
G
4
Posts: 139
Reputation: 2,586

Post » Fri May 15, 2015 12:55 pm

crypticblonde wrote:Could you be more specific about how it didn't work as you would like?


Sure, let me try to explain better....

at that moment, all I want is to move a disc (buck), as in a game of air hockey, but without the disc that is in the hand of the match. He would be invisible in the case. I want to see only the buck on the screen.

With the help of TheDom, I already managed to put the buck and the disk (which is still visible) already play it with the movement of my finger. But the buck is moving alone on the screen, and if I put the speed to 0 as suggested, the disc don't hit the buck.

Forgive me for so dumb questions, but I'm learning to use the program, and I did not find examples of this in any tutorial or in the forum.

I'll have more questions after that, but to start, if I could it already be the beginning of learning.

Thanks
B
3
Posts: 6
Reputation: 187

Next

Return to How do I....?

Who is online

Users browsing this forum: 25games, Ashley, TRMG and 25 guests