HELPP PLEASE! Specifying touch

Get help using Construct 2

Post » Wed Nov 21, 2012 12:28 pm

After running through tutorial, manuals and forums, and pm'ing, I guess i will have to ask this out here..

How to limit action from taking the coordinate of a specific touch?

eg.
capx




the intention here is to move the playerbox ONLY when the touching the "Control" sprite & move the player towards the direction that ONLY THAT touch generates!

However, I failed to limit the "action" to take touch.x, and touch.y from ONLY the touch that touches "Control" sprite.


PS:To reproduce this "Error" in capx, you will have to touch outside of the "control sprite" first, and then proceed to touch the control. playerbox will move in the direction to the touch that is not touching the "control sprite" as opposed to move in direction to the touch that is touching the "control sprite".ZhaoYun2012-11-22 02:53:42
B
12
S
4
G
4
Posts: 64
Reputation: 4,014

Post » Wed Nov 21, 2012 6:27 pm

Touch.X and Touch.Y always takes the coordinate of the first touch.

How do we get the coordinate of 2nd, 3rd, and 4th touches?ZhaoYun2012-11-23 12:57:31
B
12
S
4
G
4
Posts: 64
Reputation: 4,014

Post » Thu Nov 22, 2012 2:54 am

Hello? anybody there..?
B
12
S
4
G
4
Posts: 64
Reputation: 4,014

Post » Thu Nov 22, 2012 3:38 am

1. Describe what the end result is suppose to be.

2. Describe the problem you have with the implementation.
B
16
S
6
G
6
Posts: 100
Reputation: 4,840

Post » Thu Nov 22, 2012 11:13 am

@Julmust
Thanks for taking interest in my problem.

P.S.: Touchpad is named "Control" sprite in the picture.

I was planning to set up 2 touch-analog control stick for player1, and player2.
Each player touches their "Touchpad" and control their own respective players.
I plan to achieve this by moving the playerbox at the angle between origin of "Touchpad" and the coordinate of Touch.
(Move player 5 pixel by(angle(touchpad.x,touchpad.y,touch.x,touch.y)

This implemention failed because other touches that is not touching touchpad influence the direction of player movement too.

Conclusion of my problem: I want to limit the expression touch.x,touch.y, to the touch that only touches the touchpad.
B
12
S
4
G
4
Posts: 64
Reputation: 4,014

Post » Fri Nov 23, 2012 11:37 am

Still desperately waiting for answer.

Does construct 2 has expression for coordinate of each touch?

for example the famous multi touch plugin allows expression of
TouchX(0) First touch
TouchX(1) Second touch
B
12
S
4
G
4
Posts: 64
Reputation: 4,014

Post » Thu Jan 17, 2013 11:28 pm

You need to use TouchforID. This will mean the sprite is only effected by touches on it....and no other touch. I have an example if you still need it.
B
19
S
3
G
2
Posts: 212
Reputation: 4,011

Post » Fri Jan 18, 2013 1:39 am

Kenhes got it. AFter months of working on this problem Ahsley put in the ForId. It is mandatory to make touch controls work correctly.

The alternative is to use a drag and drop box, but it has a caveat to watch for :P
B
87
S
18
G
9
Posts: 2,455
Reputation: 14,834

Post » Fri Jan 18, 2013 6:30 pm

@Kenhes @jaderyu TouchforID ? that's new to me!

How do we use it exactly?! I want to know!!

(Did a quick search on the forum, no thread about TouchforID yet!)
B
12
S
4
G
4
Posts: 64
Reputation: 4,014

Post » Fri Jan 18, 2013 6:43 pm

Here's an example in this thread. See the last image for the most up to date.

Touch ID
B
19
S
3
G
2
Posts: 212
Reputation: 4,011

Next

Return to How do I....?

Who is online

Users browsing this forum: DiabloOvermind, Skebab, spcsmrf, Yahoo [Bot] and 21 guests