-- copy all globals into locals, some locals are prefixed with a G to reduce name clashes
local coroutine,package,string,table,math,io,os,debug,assert,dofile,error,_G,getfenv,getmetatable,ipairs,Gload,loadfile,loadstring,next,pairs,pcall,print,rawequal,rawget,rawset,select,setfenv,setmetatable,tonumber,tostring,type,unpack,_VERSION,xpcall,module,require=coroutine,package,string,table,math,io,os,debug,assert,dofile,error,_G,getfenv,getmetatable,ipairs,load,loadfile,loadstring,next,pairs,pcall,print,rawequal,rawget,rawset,select,setfenv,setmetatable,tonumber,tostring,type,unpack,_VERSION,xpcall,module,require

local apps=apps
local win=win


local function print(...) _G.print(...) end

local wstr=require("wetgenes.string")

module("bulb.bag")

function bake(state,bag)
	local bag=bag or {}

	local cake=state.cake
	local game=cake.game
	local sheets=cake.sheets
	local field	=state.rebake("bulb.field")
	local cells	=state.rebake("bulb.cells")
	local ball	=state.rebake("bulb.ball")
	local play	=state.rebake("bulb.game_play")
	local gui	=state.rebake("bulb.gui")
	local can	=state.rebake("bulb.can")
	
	local gl=state.gl
	local canvas=cake.canvas

	local sgui=state.rebake("wetgenes.gamecake.spew.gui")
	local sprofiles=state.rebake("wetgenes.gamecake.spew.profiles")



	function bag.loads()
	end
	
	function bag.setup()

	end
	
	function bag.clean()
	end

	function bag.update()

		if play.pause then
			gui.update()
		end

	end

	function bag.draw()

		if play.pause then
			gl.Color(1,1,1,1)
			sheets.get("popballs"):draw(1,160,240,0,512,512)
			gui.draw()
		end

		gl.Color(1,1,1,1)

	end
	
	
	return bag
end
