Analog stix

Get help using Construct 2

Post » Sat May 11, 2013 4:27 am

I successfully incorporated the arcade joystick on page three of this tutorial
https://www.scirra.com/tutorials/398/touch-stick-controllers/page-1

and it works really well, but I want to know how can I use it in events?
Like how do I make it that if the analog stick is quickly tapped, something occurs, or if it is moved in different ways where different actions occur?

To be more specific I'm trying to get a walking, fast walking, and running thing going on with this as it depends on how the analog stick is moved.Basilboy2013-05-11 04:29:07
B
11
S
2
Posts: 91
Reputation: 1,017

Post » Sat May 11, 2013 8:11 pm

bumpity
B
11
S
2
Posts: 91
Reputation: 1,017

Post » Sun May 12, 2013 2:58 am

bump...please I would like some help. Or if someone could message the author of that tutorial my question, jayderyu, that would be great. For some reason I can't private message anyone.
B
11
S
2
Posts: 91
Reputation: 1,017

Post » Sun May 12, 2013 3:10 am

Here you go!

I think it's what you are looking for. If not, just let me know with @sqiddster.sqiddster2013-05-12 03:39:01
B
90
S
30
G
24
Posts: 3,189
Reputation: 32,400

Post » Sun May 12, 2013 4:14 am

I don't think that's quite it.
https://dl.dropboxusercontent.com/u/30826419/Analog%20Stick%20touch.capx

Here is the analog stick, I'm not wanting to use any real gamepads.
B
11
S
2
Posts: 91
Reputation: 1,017

Post » Sun May 12, 2013 9:49 am


Assuming player has some kind platform or 8 directional movement.
Compare the stick XP(X Percentage) and YP(Y Percentage)

Compare Value stick.XP > 30
-- player.simulate(moveright)
-- player.setSpeed = absolute(stick.xp * 5)

Compare Value stick.XP < -30
-- player.simualte(moveleft)
-- player.setSpeed = absolute(stick.xp * 5)

... so on etc.
B
87
S
18
G
9
Posts: 2,455
Reputation: 14,834

Post » Sun May 12, 2013 9:03 pm

[QUOTE=jayderyu]
Assuming player has some kind platform or 8 directional movement.
Compare the stick XP(X Percentage) and YP(Y Percentage)

Compare Value stick.XP > 30
-- player.simulate(moveright)
-- player.setSpeed = absolute(stick.xp * 5)

Compare Value stick.XP < -30
-- player.simualte(moveleft)
-- player.setSpeed = absolute(stick.xp * 5)

... so on etc.[/QUOTE]

Thanks. Could you explain what player.setSpeed = absolute(stick.xp * 5) does?

Also is there a way to recognize if the player quickly tapped the analog all the way?Basilboy2013-05-12 21:03:38
B
11
S
2
Posts: 91
Reputation: 1,017

Post » Sun May 19, 2013 3:56 am

bump
B
11
S
2
Posts: 91
Reputation: 1,017


Return to How do I....?

Who is online

Users browsing this forum: GSquadron and 25 guests