How do I add a controller to my game?

0 favourites
  • 14 posts
From the Asset Store
Small pixel icons for the 3 most popular controller types.
  • Hello C2 community! I'm sorry guys, but I searched every tutorial and forum post on gameplay controls and found nothing relating to my current dilemma... I finally got my actor/sprite to sync in my platform game(Keyboard controlled at the moment), but now I want to add the ability to use a gamepad controller (ah la XBOX 360 controller)... I have a Logitech computer gaming controller I picked up at best buy a few years ago. My CPU recognizes the controller so I think I'm good on that end... I already added the gamepad icon to my project, so I'm just awaiting commands at this point... I hope it's nothing simple-like that I missed when going through the manual, but I doubt it... Any help would be most welcomed as I'm trying to make some real progress with this project... I know I'm in for a very long ride in trying to learn this program but I won't be detrude...

  • Ok nvm... lol!!! I think I may have found something in the manual... But I'm still not certain my Logitech will work right... The manual raves about the XBOX 360 controller for windows so I may have to look into that if My controller fails to respond... Keep my fingers crossed...

  • BTW... If anyone know if I can use my actually 360 console controller, please inform me before I go inquire at my local gamestop, or best buy store(s).... Again thanks!

  • Ok does anyone know if I need to turn off Default controls to off in order to simulate with the gamepad controls instead?

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • okay guys I just can't figure it out and I'm completely stumped... I don't want to do anything to mess up what I got going so I'm reaching out to you the community... If someone could upload a tutorial that specifically deals with integrating a gamepad controller into a platform game I would appreciate it... A vid would be nice, but I'll take anything at this point... again thanks for any help folks <img src="smileys/smiley14.gif" border="0" align="middle" />

  • Ok, so since I'm talking to myself (no offense community members) I might as well share what I've learned: The gamepad seems to be recognized by my computer so on that end I'm good... Now surfing the internet early today, I found out that the browser you use with your project has a lot to do with the gamepad operating properly... Also plug-ins may be needed as well... So My guess is: Scirra did not forsee people wanting to implement gamepad controls into their project at the initial development of construct, and now they are try to work that feature in through updates and/or plug-in add-ons... Not really sure what the case is but It is a bit disappointing that it's way more difficult to sync in a gamepad as oppose to using the default keyboard... Hopefully implementing other "new" features won't be as difficult.

  • Ok let's experiment here... Revisited a post from this site's forum (New chrome version support/Direct Input gamepads) And mostly the thought process was try all gaming controllers and praying for a high rate of success... Well I just plugged in my XBOX 360 into my cpu and behold... My computer recognized the controller and installed it... Very nice indeed, but we're only 25% complete on my goal... Still have to get Construct (and I'm sure Chrome as well) to recognize... Tried to look in chrome's settings for an option for the gamepad plug-in or whatever, but came across nada... Will continue to search online for some sort of information that can guide me from this point... Maybe I can get to birds by figuring out my Logitech controller gamepad issue as well...

  • I'm also trying to get 360 controller support for my game..it currently only uses the keyboard... I thought I found a forum post somewhere that discussed a quick way of adding controller support.. after a quick search i did not find it... so I'm not sure how well it works..

  • Chrome support is default... it will work, you don't have to do anything.

    As far as in-game support.. either use 'Simulate' or use the Gamepad events themselves.

    start with this..

    create a textbox..

    add an event for the Gamepad.

    use Gamepad 0 any button pressed

    for the action use set text to "button pressed:" & Gamepad.LastButton(0)

    0 is your first controller

    1 is your second controller etc...

    this will give you the value of what each of your button presses produce..

    the analog sticks also have an axis parameter which you can check as well..

  • Here's a simple file I made with working controller support. I have no special plugins or anything like that. Just the Chrome browser and a plugged in controller.

    By the way, I'm using a PS3 controller with special drivers I downloaded that basically make the PC think it's an Xbox 360 controller. I only own a PS3, so that was my workaround. <img src="smileys/smiley2.gif" border="0" align="middle" />

    Movement is with the D-Pad left and right and Jumping is set to the "A" button on a 360 controller.

    I hope this helps.

    dl.dropboxusercontent.com/u/98323832/Construct2/Controller%20Test.capx

  • Oh man!!!! Thank you guys!!!! I haven't checked on this post in a bit... Thank you jobel and Mcflygold!!! I've been trying to figure out ways around using events at all in my game... But my luck has ran out :/ So now I'm back online filtering through tutorials again... I'm getting better at using C2 which is a good thing really... Anyway, appreciate you guys taking the time to chime in <img src="smileys/smiley2.gif" border="0" align="middle" />

  • thanks, I checked that out... cool..

    I had to download new drivers for the MadCatz controller at

    microsoft.com/hardware/en-us/d/xbox-360-controller-for-windows

    The Madcatz site doesn't seem to support their own Gamepad, so don't bother looking there.

    but after the driver update, all was easy..

  • Awesome!!!! Ok, I'll check that link out asap jobel! appreciate you sharing this with me <img src="smileys/smiley32.gif" border="0" align="middle" />

  • Thank you so much for this too, jobel =)

    D-Pad is working, but I'd rather use the Left stick as with 95% of the games. Any help? Ashley

    ---

    Edit: It was the "Compare Axis" thingie. Pretty useful! Might do a tutorial soon =)

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