1
\$\begingroup\$

Instead of having a file with load, update,and draw can i say have a table called player, then put love.update and love.draw in that table to handle the drawing and updating of that particular player?

\$\endgroup\$
1
\$\begingroup\$

These functions are called by Love without knowing the rest of your program. It cannot know that they are inside a player table. As far as I know you cannot register other functions in their place, so you would need to call them from within the main update, draw etc. calls.

If you want to control the flow of your program, you can create some object with draw, update etc. functions that are the only things called in main functions. Once you got that, you can redirect them as you like for example to your player table. But ultimately you need to have to provide these functions so Love makes calls to your code.

\$\endgroup\$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.