repcomm / gameinput-ts Goto Github PK
View Code? Open in Web Editor NEWprocedural input for javascript/typescript
Home Page: https://www.npmjs.com/package/@repcomm/gameinput-ts
procedural input for javascript/typescript
Home Page: https://www.npmjs.com/package/@repcomm/gameinput-ts
A major API change will occur in the next version
In the next version, all glue code will be removed.
Two kinds of inputs:
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.
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.
pointerAxisScale, gpAxisScale, uiAxisScale
Need to add check for when no gamepad is available from perspective of browser API
Line 72 in f21ffe9
Simply commenting this out fixes the issue.
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:
Due to this specification in snowpack, importing the library fails due to mod.js
exporting typescript types.
I can try and make a PR, but basically what makes it work is ensuring mod.js only exports references to actual JS code, such as GameInput
and leave the rest up to the .d.ts files.
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);
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.