Hello everyone,
First post so forgive me if the formatting isn't correct. I am making a game right now in which I am using an arduino and some floor sensors to act as the controller. I've got it working (kind of) using UDP send/receive packets from Processing ---> love2d. My issue here is that it doesn't work all the time and sometimes it isn't as responsive as I would like it to be. There has to be an easier way to do this. I've got 4 "buttons" that are triggered by weight sensors (a reading from 0-1025, 500 or so being "on"). All i need is an on/off state.
I've seen that there is a "joystick" function but I haven't seen anything where I can set up my buttons to act as a button. Hopefully this is something super obvious that I have looked over.
Any suggestions how I can get this to work more efficiently would be greatly appreciated.
How do you create your own controller?
Forum rules
Before you make a thread asking for help, read this.
Before you make a thread asking for help, read this.
-
- Prole
- Posts: 2
- Joined: Tue Apr 07, 2015 4:35 pm
Re: How do you create your own controller?
Löve relies on SDL for things like these, so if you can make your Arduino be identified by SDL as a controller, you're good to go. Finding info about that might be easier, since SDL is more commonly used than Löve.
I also know that, from within Löve's source code, it's possible to "hack" things to be registered as controllers by Löve. The Android and iOS ports use this to make the accelerometer available as a controller. So if you can make the input available without lag in C++, you can probably hack it together if you're ready to modify Löve's source code.
Hope this helps you a little
I also know that, from within Löve's source code, it's possible to "hack" things to be registered as controllers by Löve. The Android and iOS ports use this to make the accelerometer available as a controller. So if you can make the input available without lag in C++, you can probably hack it together if you're ready to modify Löve's source code.
Hope this helps you a little
My game called Hat Cat and the Obvious Crimes Against the Fundamental Laws of Physics is out now!
-
- Prole
- Posts: 2
- Joined: Tue Apr 07, 2015 4:35 pm
Re: How do you create your own controller?
Awesome I will check it out.T-Bone wrote:Löve relies on SDL for things like these, so if you can make your Arduino be identified by SDL as a controller, you're good to go. Finding info about that might be easier, since SDL is more commonly used than Löve.
I also know that, from within Löve's source code, it's possible to "hack" things to be registered as controllers by Löve. The Android and iOS ports use this to make the accelerometer available as a controller. So if you can make the input available without lag in C++, you can probably hack it together if you're ready to modify Löve's source code.
Hope this helps you a little
Thanks!
Re: How do you create your own controller?
It will probably be a lot harder to use the controller interface than hack something together with a DLL/so library. For example you could cut out the Processing middleman and instead open the COM port on it's own: https://github.com/edartuz/lua-serial
The controller interface is meant for Gamepads like PS3 and XBox controllers and they need to be detected by a system driver to work (afaik).
The controller interface is meant for Gamepads like PS3 and XBox controllers and they need to be detected by a system driver to work (afaik).
Who is online
Users browsing this forum: Ahrefs [Bot], Google [Bot] and 2 guests