-- write out that we loaded sucessfully (mor or less, anyway)
io.write("Starting script for Level3 in BlinkenLUA / ",_VERSION,"!\n")
bs.callback.engine.init("initLevel");
-- declare some global variables
GFX_HUNTINGSEASON = {};
OBJ_HUNTINGSEASON = -1;
HS_COUNT = 5;
HS_SHOWN = 1;

-- Required function: Initializing the level
function initLevel ()
    -- preload all gfx (on-the-fly loading is NOT recommended)
	
    GFX_HUNTINGSEASON[0] = bs.gfx.load("fg_huntingseason.bmp");
	GFX_HUNTINGSEASON[1] = bs.gfx.load("fg_huntingseason_neon.bmp");

    -- create sign
    OBJ_HUNTINGSEASON = bs.obj.new(30*32, 30*32, GFX_HUNTINGSEASON[1], "visible");

	bs.callback.engine.physics("scriptPhysics");
end

-- Required function: Physics-loop for scripting part
function scriptPhysics ()
	HS_COUNT = HS_COUNT - 1;
	if HS_COUNT == 0 then
		HS_SHOWN = 1 - HS_SHOWN;
		OBJ_HUNTINGSEASON.gfx(GFX_HUNTINGSEASON[HS_SHOWN]);
		if HS_SHOWN == 0 then
			HS_COUNT = 50;
		else
			HS_COUNT = 25;
		end
	end
end

