yes, but i’ll post code
--
-- overlordModule.lua
--
---------------------------------------------------------------------------------
local json = require "json"
local loadsave = require("loadsave")
local turnControl = function ()
-- all the code for advances game turn and player turn number
return true
end
the mainGame.lua file looks like this
[code]
–
– mainGame.lua
local storyboard = require( “storyboard” )
local scene = storyboard.newScene()
local json = require “json”
local widget = require “widget”
local loadsave = require( “loadsave” )
local loader = require( “loader” )
local overlordMod = require( “overlordModule” ) – The attempt at making a module
– followed by many variables and lua tables
– Called when the scene’s view does not exist:
function scene:createScene( event )
local screenGroup = self.view
– completely remove mainmenu and creditsScreen
storyboard.removeScene( “overlord” )
print( “\nmaingame: createScene event” )
end
– Called immediately after scene has moved onscreen:
function scene:enterScene( event )
local screenGroup = self.view
print( “\nmainGame: enterScene event” )
– create display groups
local mainDisplay = display.newGroup()
local editMenu = display.newGroup()
local contextMenu = display.newGroup()
local panel = display.newGroup()
local research = display.newGroup()
local leader = display.newGroup()
local transfer = display.newGroup()
local market = display.newGroup()
local victory = display.newGroup()
local timecounter = display.newGroup()
– followed by a lot of various code
– Initializes all functions created
local turnStart = function()
collection()
print(“Collection Completed”)
mapDraw()
print(“mapDraw Completed”)
panelDraw()
print(“panelDraw Completed”)
location()
print(“location Completed”)
end
– First call
print( “maingame: enterScene event” )
overlordMod.turnControl() – This is me trying to call the function from inside overlordMod Module
turnStart()
end
– Called when scene is about to move offscreen:
function scene:exitScene()
print( “maingame: exitScene event” )
end
– Called prior to the removal of scene’s “view” (display group)
function scene:destroyScene( event )
print( “((destroying maingame view))” )
end
[/code] [import]uid: 170004 topic_id: 36257 reply_id: 144033[/import]