Hi,
in the gideros book, I saw Arturs using this technique below which is basically to pass entire scene to another class so you can call scene methods and use scene properties from it:
Then let's define the init method of our MainBall class. It should accept three arguments, level, the reference to scene instance, and x and y, the position where it should be placed on the scene. We will save the reference to the scene as a self.level instance property.
function MainBall:init(level, x, y)
self.level = level
self:setPosition(x,y)
end
I wonder if this is a good technique and I am concerned about memory leaks if might cause. I like it though and it is very simple method.
Comments
Anyway current scene is sceneManager.scene1
Likes: boriskey