How do I (Ball slide between lines) RESOLVED

Get help using Construct 2

Post » Sun Jun 29, 2014 10:24 pm

Guys, how could I make small balls, sliding into a pentagram (5 lines), and they can only move with the mouse to the vertical and horizontal, these balls can walk through any one of the 5 lines.

Thanks in advance.
Last edited by Rony Sueliton on Sun Jul 06, 2014 2:07 pm, edited 1 time in total.
B
11
S
3
G
1
Posts: 105
Reputation: 1,135

Post » Sun Jun 29, 2014 11:41 pm

Can you provide a drawing? I don't think I've understood right. :/

This? http://www.scirra.com/arcade/games/examples/139/waypoints
B
34
S
5
G
1
Posts: 164
Reputation: 2,725

Post » Mon Jun 30, 2014 12:38 am

@Scofano, the green ball must be moved to another line when the left mouse button is pressed. The ball must be moved horizontally to walk on the line.

As if the line had a magnet that attracts the ball to her.

Exemplo abaixo:

https://www.dropbox.com/s/0w34xsdwe0cl7 ... 0ball.capx
B
11
S
3
G
1
Posts: 105
Reputation: 1,135

Post » Mon Jun 30, 2014 1:16 am

Isso que vc quer? http://www.scofano.com.br/sandbox/rony.capx
(click left and right buttons)
B
34
S
5
G
1
Posts: 164
Reputation: 2,725

Post » Mon Jun 30, 2014 1:18 am

If you dont want the green ball to get out of your lines, just make another "x comparison" with minimum and maximum values.

If you want the ball to MOVE (instead of teleporting), use this: https://www.scirra.com/forum/behavior-litetween_t70700
B
34
S
5
G
1
Posts: 164
Reputation: 2,725

Post » Thu Jul 03, 2014 3:44 am

Scofano wrote:Isso que vc quer? http://www.scofano.com.br/sandbox/rony.capx
(click left and right buttons)


That's exactly what I was looking for, but once you have caught the coordinates in X, how do I release the ball with a double mouse click? I've tried everything and I can not.
B
11
S
3
G
1
Posts: 105
Reputation: 1,135

Post » Thu Jul 03, 2014 2:34 pm

You've got to create a variable "drag", and use this example to activate it or deactivate it using double click.
http://www.scofano.com.br/sandbox/dash.capx

It is a dash using keyboard but the method is the same.
B
34
S
5
G
1
Posts: 164
Reputation: 2,725

Post » Sun Jul 06, 2014 2:07 pm

Thanks for the ideas mentioned, I got through the various trials and errors develop an ideal for what I was looking for solution.
The problem was: Catching a ball and clicking anywhere on the line, the ball would have to sit on the clicked point.

With this system does not leave the ball over the line. Check out the results below:

ball line.png


Thank you guys!
You do not have the required permissions to view the files attached to this post.
B
11
S
3
G
1
Posts: 105
Reputation: 1,135


Return to How do I....?

Who is online

Users browsing this forum: Yahoo [Bot] and 29 guests