I have my tutorial.love file attached, and as you can see, I followed his tutorial almost identically. His code for the episode is on hit github here: https://github.com/bncastle/love2d-tuto ... /Episode12
Note: His video is from May of 2017, which is quite a few versions behind what I am using. I am using Love2d 11.2. I have worked around this for the most part.
In my GamepadManager.lua file, I have an empty table called self.connected_sticks, which holds the key as joystick:getID() and the value as the joystick object itself. The class uses functions which check if the joystick with the given ID in the table presses buttons, exists, etc.
I am using a SNES gamepad from INEXXT for input, so to make sure the SDL mappings are correct and the program recognizes the button presses, I have the following line in main.lua > function love.draw()
Code: Select all
love.graphics.print(tostring(GPM:button(1, "a"),70,10))
Code: Select all
Error
lib/GamepadManager.lua:93: attempt to index field 'connected_sticks' (a nil value)
Traceback
lib/GamepadManager.lua:93: in function 'button'
main.lua:84: in function 'draw'
[C]: in function 'xpcall'
Any help will be useful. I plan to use the forums and the rest of the tutorials to make my own library and 2d Smash Bros. style game for Love on the RetroPie. Cheers.