GithubHelp home page GithubHelp logo

repcomm / gameinput-ts Goto Github PK

View Code? Open in Web Editor NEW
2.0 2.0 0.0 138 KB

procedural input for javascript/typescript

Home Page: https://www.npmjs.com/package/@repcomm/gameinput-ts

TypeScript 99.53% HTML 0.47%
input remap html javascript lib npm typescript

gameinput-ts's Issues

Next update

A major API change will occur in the next version

In the next version, all glue code will be removed.

Two kinds of inputs:

  • button
  • axis

Anything can be an axis, anything can be a button.
All mappings will be runtime configurable
Mappings will be able to be saved and loaded from JSON

DOM events can also be hooked to buttons and axis, which will solve the mobile touch button problem.

A package will be created using exponent-ts and gameinput-ts as dependencies, providing
a user input mapping panel which can be mounted anywhere in the DOM at any time, and can have events fired to trigger an input manager instance (or several) changed to match.

Possible name change

I've used this project is way more apps than games at this point,
I'm thinking of renaming to something like procedural-web-input or something similar.

Unfortunately I'd have to do annoying things to the repo and npm install location,
not thrilled about that.

Configurable dead zones for gamepad interface

Having axis mapped to both keyboard, touch, and gamepad will mean that gamepads can have their dead zones interfere with setting the input value.

Things that can be done to mitigate this:

  • get highest value from all the inputs of an axis, return that
  • add dead zone configuration per gamepad axis (and possibly touch as well)

Axis should be mappable to any set of inputs

Currently, axes are only mapped to gamepad axes, but mouse wheel, and mobile touch axes (not implemented as of yet), and even keyboard buttons should be able to be mapped to axes.

Something like this for keyboards:

GameInput.get().createAxis ("fwd-bwd")
.addKey("w", 1.0)
.addKey("s", -1.0)
.addGamepadAxis (13);

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.