So calling the love api from another class other than the main class/table ex.
Code: Select all
image = love.graphics.newImage('p1.png')
singletons - if the api was limited to the main class I can just make the call through a singleton
dependency injection - Just passing the "object" to the child class can give it access to the api
another way I have seen it done specifically in lua is
mocking function - I seen an example of this in the anim8 library (https://github.com/kikito/anim8)
Is there an easier way to get around this? Or are any of these 3 technices something I may have to apply? I appreciate any help.
Thanks,
Visions