print("\nDebug.lua " .. os.date("%H:%M %d %b %Y"))

print("ghf.settings", ghf.settings)
for k, v in pairs(ghf.settings) do
	print(k, v)
end

print("GameTree members:")
for k,v in pairs(gameTree) do
	print(k, "=", v)
end

print("\n\nGameTree metatable members:")
for k,v in pairs(getmetatable(gameTree)) do
	print(k, "=", v)
end

-- We can get to Sprites via the game tree
print(gameTree)
s = gameTree:child("BUTTON_QUIT")
print(s)

-- We can get to Sprites via the current scene
print(scene)
s = scene:child("BUTTON_SETTINGS")
print(s)
if s ~= nil then
	s:setScale({x = 1.5})
	s:setVisible(not s:visible())
	s:setAnchorPoint("left")
	s:set({image = "FishStrip:scenegame_2_SHPRK_AMB", x = s:x() + 10})
end

w = scene:child("LABEL_WELCOME")
print(w)
if w ~= nil then
	w:setText(w:text() .. " Délüxe β © 東京")
end

local	fish1 = scene:newChildSprite(
	{x = 50, y = 150, image = "FishStrip", section = "scenegame_2_SHPRK_AMB", name = "fish1"})

local	b = scene:newChildSprite(
	{class = "Button", x = 40, y = 200, image="IMAGE_BUTTON_MENU_INGAME", section="scenelevels", enabled=false, command="MENU"})
print(b)

-- <Button name="BUTTON_MENU" hitmaskthreshold="0.75" x="7" y="556" image="IMAGE_BUTTON_MENU_INGAME" setup="DEFAULT_BUTTON" command="MENU" clicksound="SOUND_BUTTON" section="scenelevels" soundsection="default" />

local	p = scene:newChildSprite(
	{class = "ParticleEffect", x = 100, y = 400, library="PARTICLE_START_BUTTON", section = "scenemap"})
print(p)
p:play()

if not fire then
	print("Starting FireSFX")
	ghf.startLoading("scenegame_3_LIVNG_AMB", false)
	ghf.loopSound("SFX_Target_57doorclosed:scenegame_3_LIVNG_AMB")
	fire = true
else
	ghf.stopLoop("SFX_Target_57doorclosed:scenegame_3_LIVNG_AMB")
	fire = false
end