Gamepad simulating keystroke

Get help using Construct 2

Post » Tue May 07, 2013 6:05 am

hi guyz,

i'm fairly new to C2 and i'm trying to understand how the controls of he gamepad work. So far i'm doing not too bad except for 1 thing.

here's an example of what is blocking me :

as every games, i got some selection menu with cursor. Using the keyboard to move the cursor up and down one options at a time is great, but i couldn't figure the way to do it with gamepad. As the axis goes form -100 to 100, as as soon i'm doing a event with condition greater than or smaller than, the selection cursor is not moving by one, but just moving really fast between options.

i wish i could find a way so the gamepad axis move the cursor only by one at a time. I've tried some expressions with the rawAxis but still have gin trouble the logic to make it work. :\

thx in advance.

B
3
Posts: 8
Reputation: 318

Post » Tue May 07, 2013 11:34 am

Create a sprite called "cursor". When you hold up/down/left/right on the gamepad, the cursor sprite goes to that direction. Now if the cursor sprite is overlapping buttons on the menu AND the A button( or X/1, whatever) is pressed, the game starts game/goes to options/ quits game (depending on what button was pressed).
HARMLESS SIGNATURE THAT IS VIEWED BY OTHERS AS OFFENSIVE AND CONTROVERSIAL
B
14
S
3
G
3
Posts: 356
Reputation: 4,362

Post » Tue May 07, 2013 12:48 pm

that's is the point. i dont want the cursor to move arround freely. i've set a menu like combat menu un final fantasy. so basically the selection cursor move from 1 option to another, not all the way around.

i have hidden the mouse in those menu so there's is only the selection cursor associated to the menu that showing up.

here's a quick example of the problem :

FF_menuStyle2.capx
B
3
Posts: 8
Reputation: 318

Post » Tue May 07, 2013 5:50 pm

Create two distinct events. One for the keyboard, one for the Gamepad. In the gamepad event, add a "trigger once while true" condition (found under the System condition)

The keyboard event is already a trigger, so no need for that second condition there.
B
46
S
17
G
18
Posts: 847
Reputation: 13,802

Post » Tue May 07, 2013 10:27 pm

thx a lot !!
still have a lot to learn about C2 ! :)
B
3
Posts: 8
Reputation: 318


Return to How do I....?

Who is online

Users browsing this forum: 99Instances2Go, plinkie and 19 guests