Quick Links: Download Gideros Studio | Gideros Documentation | Gideros Development Center | Gideros community chat | DONATE
passing whole scene to another class — Gideros Forum

passing whole scene to another class

boriskeyboriskey Member
edited July 2014 in Game & application design
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

Sign In or Register to comment.