In your guide, you give instructions on how to execute keyboard commands. Well, I've implemented your example code, and it works. But the problem lies in when I get a gameover and need to restart everything. If I try running a gameover function that resets everything and reruns the setup() function, I end up with all of my keyboard inputs getting duplicated somehow and executing multiple times per button press. I think this has to do with the event listeners being added to the window, but is there any way I can get around this?
I’m new to PIXI, but I think you could initialize keyboard objects at global level, outside any function. So that they are not re-initialized. I’m not sure about this
In your guide, you give instructions on how to execute keyboard commands. Well, I've implemented your example code, and it works. But the problem lies in when I get a gameover and need to restart everything. If I try running a gameover function that resets everything and reruns the setup() function, I end up with all of my keyboard inputs getting duplicated somehow and executing multiple times per button press. I think this has to do with the event listeners being added to the window, but is there any way I can get around this?
Thanks.