lydzje / lynput Goto Github PK
View Code? Open in Web Editor NEWLynput is an input library for LÖVE that makes input handling very easy and intuitive :blue_heart:
License: MIT License
Lynput is an input library for LÖVE that makes input handling very easy and intuitive :blue_heart:
License: MIT License
This might be a bit advanced and wouldn't work as intuitively as the other features (at least not the way I see it), but it'd be very interesting and useful if we could have control over how long an input has been pressed for.
Some examples would be of an input that only fires if you hold a key for N seconds (a powerup/boost attack, or a dash, or a heavy action). Syntax could be something like this:
control:bind(
"longFire",
{
"hold z for 5"
}
)
This would fire if, and only if, the key had been held for at least 5 seconds, and would continue outputting until it's released.
Another example would be to only let a key be held for N seconds, then forcibly "release" it. This could be useful to control stuff like long-distance jumping, or lifting a heavy object.
control:bind(
"heavyPickup",
{
"press x after 5"
}
)
Perhaps the two properties could be combined, though personally I don't see a use for that. One last suggestion, which I'm also not particularly fond of (but still useful for game developers), would be to allow rapid key-pressing within an interval. With this option, players would have to continuously press a key for an action to take place. You'd only need to set the "keypress interval" and it'd correct for when the player presses/releases it, resetting the timer. Could be used in quicktime events, or making a character turn a valve, or a hacking sequence.
control:bind(
"rotateHandle",
{
"press x every 0.5"
}
)
I believe these could be combined, but doing so in an intuitive and elegant way might be a challenge. There are also other, more nuanced ways in which timing could be useful and these suggestions wouldn't attend. Regardless, this is a very neat library with or without this feature!
For example:
control:bind(
"highKick", "press shift+k"
)
There should be a better way to obtain analog values rather than using getAxis(). Since Lua is dynamically typed I think that adding the value to the action is a good solution.
if controls.speed then car:speed(controls.speed) end
Also, not specifying an interval when binding an analog input to an action should be possible and it would mean the interval is min:max
.
hold
may be confusing for users, so some alternative names for this button state are:
holdDown
hold-down
hold_down
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.