Object related problem

Is there a away to use one object from one lua file to the other lua file?
eg.i have a file called bullet.lua where i have set all the bullet properties.Now what i want is to use this bullet in my level1.lua file.
Is this Possible?

im using modular programming like this, its very simple and very efficient method
my otherfile.lua:

1
2
3
4
5
6
7
8
9
local Public = {} -- this is table you need to store the function you need to pass into another file
 
local function foo()
local image = display.newImage(...)
end
 
Public.foo1 = foo 
 
return Public

Thanks for the Help..I got that but how to use this "image" to the other lua file so that we can use this "image " accordingly.

All you have to do is require bullet.lua from any module, and you will have access to the same copy that already exists. Any module which requires bullet.lua will have access to the public functions, and will see (and be able to set) the same values.

http://developer.anscamobile.com/forum/2011/12/22/variables-modularized-programming

views:1675 update:2011/12/29 9:44:01
corona forums © 2003-2011