Input differences

0 favourites
  • 5 posts
From the Asset Store
Total customisation of the input! You can combine inputs from all peripherals. Make your game accessible for everyone!
  • Hi, im coding a fighting game in c2 and started working on it in firefox nightly. it worked great but i recently switched to chrome beta because it runs a constant 13% cpu instead of 75% and holds a constant 60 fps.

    I noticed that after switching browsers, a few of my functions werent triggering. I had set a threshold for joystick Y input at 60% for jumping and greater than or equal to 60%for Y and 60% for X for diagonal jumping and also for wavedashing. It went from having a large trigger area to a hairpin trigger area.

    it only seems to affect the diagonals and strangely enough only on the right side and not the left... idk why its happening or what the difference is between browsers. I set X to 35% threshold and fixed it for chrome but now im catering to one browser over another... not sure why its occurring and i was wondering if its simply something that is already documented regarding how chrome processes joystick inputs vs firefox.

  • Many full-time game companies are afraid to put Gamepad/Joystick controls because of how tricky/buggy it is.

    You shouldn't be aiming for gamepad/joystick support on multiple web browsers, especially not for what i imagine is a hobby project. It's pretty much mission impossible, and it will almost always bug for some people.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Thanks, I appreciate it. Tell me, is it possible for us to code it to recognize (automatically) what browser type is being operated on? Then I could just have it set the threshold to a variable and adjust it based off what browser is being utilized.

  • You would have to look into the browser object

    The following expression could be used to identify browser version:

    Name

    Get the name the browser reports for itself. This may be inaccurate for backwards compatibility reasons, e.g. Google Chrome reports its name as Netscape.

    Product

    Get the product the browser reports for itself. This may be inaccurate for backwards compatibility reasons, e.g. Google Chrome reports its product as Gecko.

    UserAgent

    Return the full user agent string for the browser, e.g. Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/535.7 (KHTML, like Gecko) Chrome/16.0.912.63.

    As the manual implies, they can be inaccurate at times, but it's your only way.

  • Thanks, I appreciate it. I might use one of those methods if I can get it to be consistent, otherwise I'll probably have a user defined setting.

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