Touch controls not functioning properly?

Get help using Construct 2

Post » Wed Jun 04, 2014 8:54 pm

Hi, I am trying to set up a horizontal movement that is controlled by tapping on the left/right side of the mobile screen. Right now I have 2 full screen buttons, one on the left and one on the right. I set them to OnTouch > BTN > Simulate 8 Direction Left/Right. When I test the game and click the touch buttons, it only moves the player over by 1 pixel no matter how many parameters I adjust.

I am definitely missing something because the left and right keys on the keyboard work just fine, but for some reason touching the buttons does not.

My goal is to get movement similar to Flappy Bird, but their will be gravity and the player can tap the left or right side of screen in order to boost/jump in that direction a bit.
B
6
S
1
Posts: 71
Reputation: 548

Post » Wed Jun 04, 2014 9:07 pm

The "On Object Touched" event is a trigger, indicated by the green arrow in the event. A trigger will only fire once when the condition is true, then it will not fire until it becomes false and then true again, they do not fire every tick while true.

You need to use "Is Touching Object" instead, which is a condition rather than a trigger.
B
46
S
14
G
7
Posts: 603
Reputation: 8,106

Post » Wed Jun 04, 2014 9:38 pm

EncryptedCow wrote:The "On Object Touched" event is a trigger, indicated by the green arrow in the event. A trigger will only fire once when the condition is true, then it will not fire until it becomes false and then true again, they do not fire every tick while true.

You need to use "Is Touching Object" instead, which is a condition rather than a trigger.


Ahhh, Thank you! I will try it tonight. I guess I should read the entire manual :/
B
6
S
1
Posts: 71
Reputation: 548

Post » Wed Jun 04, 2014 11:11 pm

EncryptedCow wrote:
You need to use "Is Touching Object" instead, which is a condition rather than a trigger.


It worked perfectly :)

While you're here, can you answer this too? I only want the player to move a little bit, similar to a Jump in the Platform Behavior. Is there an easy way to do this or should I just set a Platform Behavior and rotate the player depending on the direction they tap?
B
6
S
1
Posts: 71
Reputation: 548

Post » Thu Jun 05, 2014 4:30 am

Shack wrote:
EncryptedCow wrote:
You need to use "Is Touching Object" instead, which is a condition rather than a trigger.


It worked perfectly :)

While you're here, can you answer this too? I only want the player to move a little bit, similar to a Jump in the Platform Behavior. Is there an easy way to do this or should I just set a Platform Behavior and rotate the player depending on the direction they tap?

The easiest way to do a 'flappy bird type of movement' is using the platform behavior... with the 'set vector y' action you can do the "jump".
B
20
S
4
Posts: 385
Reputation: 2,270

Post » Thu Jun 05, 2014 11:13 am

Zathan wrote:
Shack wrote:
EncryptedCow wrote:
You need to use "Is Touching Object" instead, which is a condition rather than a trigger.


It worked perfectly :)

While you're here, can you answer this too? I only want the player to move a little bit, similar to a Jump in the Platform Behavior. Is there an easy way to do this or should I just set a Platform Behavior and rotate the player depending on the direction they tap?

The easiest way to do a 'flappy bird type of movement' is using the platform behavior... with the 'set vector y' action you can do the "jump".


I will mess around with that. That will let me control a side to side motion right? Not just up with gravity pulling me down.
B
6
S
1
Posts: 71
Reputation: 548

Post » Thu Jun 05, 2014 6:17 pm

@Shack You have all the control... do a test and, if you find any difficulties, just tell me :)
B
20
S
4
Posts: 385
Reputation: 2,270

Post » Thu Jun 05, 2014 10:53 pm

Zathan wrote:@Shack You have all the control... do a test and, if you find any difficulties, just tell me :)



I don't fully understand how set vector Y works to create a horizontal jump. Also when i use the platform behavior, the character only jumps when it is touching a platform.
B
6
S
1
Posts: 71
Reputation: 548

Post » Fri Jun 06, 2014 5:58 am

Shack wrote:
Zathan wrote:@Shack You have all the control... do a test and, if you find any difficulties, just tell me :)



I don't fully understand how set vector Y works to create a horizontal jump. Also when i use the platform behavior, the character only jumps when it is touching a platform.

Oh, I didn't understand your question... for the horizontal jump, of course, use the set X vector...
And to do a jump without touch the ground, use set Y vector with a negative value.
B
20
S
4
Posts: 385
Reputation: 2,270


Return to How do I....?

Who is online

Users browsing this forum: MikaelS, nahima, Nicolas951, Shenkai the ssj and 25 guests