How do I fix my touch controls?

Get help using Construct 2

Post » Mon Mar 23, 2015 4:02 pm

The game I am creating is for Android and uses touch controls. When hold your finger on the left side of the screen the helicopter flies upwards otherwise it falls down. I also have the helicopter shoot bullets when you hold on the right side of the screen. The bullets angle themselves to the position of your finger. I used set angle towards position when spawned to make the bullets aim towards Touch.X and Touch.Y. However, sometimes the bullets will go towards the left touch as there are often multiple fingers on the screen at once. How would I get the bullets to only fly right? I would need to differentiate the left touch from the right and I have tried and failed several times to do so.
B
10
S
3
Posts: 6
Reputation: 749

Post » Mon Mar 23, 2015 4:52 pm

try using the function "Has Nth touch".
B
42
S
10
G
2
Posts: 111
Reputation: 3,773

Post » Mon Mar 23, 2015 5:13 pm

add an (invisible) sprite on the right which is your trigger to fire.

event
On touched object sprite
action
shoot
Who dares wins
B
57
S
17
G
21
Posts: 1,878
Reputation: 19,562

Post » Mon Mar 23, 2015 5:25 pm

lennaert wrote:add an (invisible) sprite on the right which is your trigger to fire.

event
On touched object sprite
action
shoot


That is what I am doing. The goal is for the bullets to aim themselves WHERE I touch.
B
10
S
3
Posts: 6
Reputation: 749

Post » Mon Mar 23, 2015 6:24 pm

Ahh, then flip it.

On the left, add a button which is your trigger to launch up ...

On the button shoot event, add

is touching objectUpDown (inverted)

So it wont trigger when you touch control to go up and down
Who dares wins
B
57
S
17
G
21
Posts: 1,878
Reputation: 19,562

Post » Mon Mar 23, 2015 7:35 pm

The idea is to have the chopper to have the ability to fly and shoot at the same time.
B
10
S
3
Posts: 6
Reputation: 749

Post » Mon Mar 23, 2015 8:08 pm

example capx

example demo



You will require to use an object you touch to have the second touch working.


Red square is elevation, blue is the target. Tested on my phone.
Who dares wins
B
57
S
17
G
21
Posts: 1,878
Reputation: 19,562

Post » Mon Mar 23, 2015 8:13 pm

Thanks so much!
B
10
S
3
Posts: 6
Reputation: 749


Return to How do I....?

Who is online

Users browsing this forum: FlyingRam, jkmalau, MadSpy, Manubis and 10 guests