Gamepad simulating keystroke

  • 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.

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • 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).

  • 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

  • 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.

  • thx a lot !!

    still have a lot to learn about C2 ! :)

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)