Getting crazy with external module

Hi!

I'm desperate as i tried every possibilities imaginable to get this module call working but all i've got are miserable crashes and nil. Note : I'm a beginner and it's the first time I use classes.

1
2
3
local wallClass = require("wallclass")
local newWall = wallClass.newWall
print(newWall) --> nil

Here is a bigger code snippet for those who would help :

main.lua

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
local wallClass = require("wallclass")
local spawnWall = wallClass.newWall
 
local world = display.newGroup()
 
local friction = 0.3
 
local shape = {
        { 0, 0, 352, 128}, { 480, 0, 352, 128 }, { 0, 128, 128, 352 }, 
        { 704, 128, 128, 224 }, { 0, 480, 832, 352 }, { 352, 288, 128, 32 },
        { 128, 480, 680, 8 }, { 360, 288, 112, 8 }, { 120, 128, 8, 352 }
}
 
for i=1, #shape do
        local w = spawnWall(shape, friction)
        world:insert( w )
end

RESOLVED :
Wasn't a global function in the module.

views:1347 update:2011/10/5 21:23:48
corona forums © 2003-2011