Hi Brent,
Sure, thanks for the update of Facebook table, I’ve cleaned the “supportedPlatforms”…
As you told, it’s not in the main.lua
In this file, there’s two points where finishes at some point doing require for “GameNetwork” …
—> this:
require “controller.animalzombies.AZController”
AZ:initialize()
—> and this:
“endSplash()”
main.lua
–require(“mobdebug”).start()
local isAndroid = system.getInfo(“platformName”) == “Android”
local background = nil
if isAndroid then
background = display.newImage(“androidSplash.jpg”)
background:scale(display.contentHeight/background.height, display.contentHeight/background.height)
background.x, background.y = display.contentCenterX, display.contentCenterY
end
require “controller.animalzombies.AZController”
AZ:initialize()
–AZ.S.purgeOnSceneChange = true
AZ.S.removeOnSceneChange = true
local function onSystem(event)
if event.type == “applicationSuspend” or event.type == “applicationExit” then
Runtime:dispatchEvent({ name = GAMEPLAY_PAUSE_EVNAME, isPause = true, pauseType = “pause” })
system.setIdleTimer(true)
----FlurryController.forceSend()
elseif event.type == “applicationResume” then
system.setIdleTimer(false)
end
end
Runtime:addEventListener(“system”, onSystem)
local function onAndroidBackTouch(event)
if event.keyName == “back” and event.phase == “up” then
if AZ.S.isInScene then
local scene = AZ.S.getCurrentSceneOrOverlay()
scene:dispatchEvent({ name = ANDROID_BACK_BUTTON_TOUCH_EVNAME })
end
return true
end
end
Runtime:addEventListener(“key”, onAndroidBackTouch)
local function endSplash()
AZ.S.gotoScene(“thousandgears.thousandgears”, { time = SCENE_TRANSITION_TIME, effect = SCENE_TRANSITION_EFFECT })
if isAndroid then
display.remove(background)
end
end
if isAndroid then
timer.performWithDelay(1000, endSplash)
else
endSplash()
end
then reviewing…
thousandgears.lua
when calls the initialize function of GameServicesController:
require “GameServicesController”
GameServicesController:initialize()
function scene:createScene(event) require "GameServicesController" GameServicesController:initialize() local bg = display.newImage("thousandgears/assets/splash\_tg.jpg") bg:scale(display.contentHeight/bg.height, display.contentHeight/bg.height) bg.x, bg.y = display.contentCenterX, display.contentCenterY scene.view:insert(bg) local loader = display.newImage("assets/loader.png") loader.x, loader.y = display.contentCenterX, display.contentHeight \*0.85 loader:scale(SCALE\_DEFAULT, SCALE\_DEFAULT) scene.view:insert(loader) local function rotate() loader.rotation = 0 loaderTrans = transition.to(loader, { time = 1000, rotation = 360, onComplete = rotate }) end rotate() end
the execution goes here…
The require call is in a file called:
GameServicesController.lua
function GameServicesController:initialize() if not active then return end local gameNetwork = require "gameNetwork" GameServicesController.loggedIntoGC = false --saveAchievementsLocal() loadAchievementsLocal() --print("\*\*\*GAME SERVICE\*\*\*: initialize "..tostring(GameServicesController.loggedIntoGC)) if (system.getInfo("platformName") == "Android") then GameServicesController.gameServiceName = "google" GameServicesController:login(true) else GameServicesController.gameServiceName = "gamecenter" GameServicesController:login(false) end end
… and there are another file:
achievementsManager.lua doing a the same require in the initial variables…
local achievementsMngr = {} achievementsMngr.dict = {} achievementsMngr.unlocked = {} achievementsMngr.perLevelWeapons = {} achievementsMngr.perLevelZombies = {} achievementsMngr.gameNetwork = require "gameNetwork" achievementsMngr.loggedIntoGC = false achievementsMngr.gameServiceName = nil achievementsMngr.savedAchievements = {}
…
and this is the other point where calls the require for “achievementManager” from main.lua
AZController.lua
local function prepare() AZ.S = require "superStoryboard" AZ.utils = require "utils" AZ.ui = require "ui" AZ.gui = require "gui" AZ.audio = require "controller.audio.audioController" AZ.animsLibrary = require "test\_animsLibrary" AZ.soundLibrary = require "soundsLibrary" AZ.zombiesLibrary = require "zombiesLibrary" AZ.atlas = require "atlas" AZ.jsonIO = require "jsonIO" AZ.fb = require "controller.fb" AZ.achievementsManager = require "achievements.achievementsManager" AZ.notificationController = require "test\_notificationController" AZ.notificationController:init({}); AZ.recoveryController = require "test\_recoveryController" AZ.recoveryController:init({}); require "constants" require "test\_constants" require "resolutions" -- AZ.translations = require "translations" AZ.loader = require "loader" system.setIdleTimer(false) display.setStatusBar(display.HiddenStatusBar) AZ.utils.activateDeactivateMultitouch(false) AZ.utils.platform = system.getInfo("platformName") AZ.soundLibrary.loadSounds() if AZ.isTest then require "debugLog" end AZ.Gamedonia = require "controller.gamedonia.GamedoniaController" AZ.Gamedonia:init() end
… What do you think?