Hello all,
so I'm designing a browser game and I'm running into clutter problems. mainly my index page is full of to much code. Now I've done my best compartmentalise my code as much as possible and send off function calls to various other .js files. However, my problem right now is that the user interacts with the game via their mouse and so I have to first capture the mouse event and then send it off to the right sub function based on what the user is trying to do. So you can imagine what my code in the mouseEvent looks like, it's atrocious.
My current method of handling user input is
-gather user inputs
-determine which flags are set to true, various flags for various tasks
-then send off user inputs and relevant scene items to a sub function to be processed.
Is there a way to maybe import mouse events in the sub functions themselves? and import the scene items without the being passed by a function call?