function init(bIsRestart)

	-- Initialise arena - backdrop_name, start_pos, is_restart
	init_level("level-future-forest", CCPoint(-50, -30), bIsRestart)

end

function onLevelIntro()

	bot_manager.MaxBotsOnScreen = 1

	say("lumberjack", localize("FORBIDDEN_ZONE_INTRO_1"), talkToFist)
	say("fist", localize("FORBIDDEN_ZONE_INTRO_2"), fistTalk)
	say("lumberjack", localize("FORBIDDEN_ZONE_INTRO_3"), talkToFist)
	say("fist", localize("FORBIDDEN_ZONE_INTRO_4"), fistTalk)
	say("fist", localize("FORBIDDEN_ZONE_INTRO_5"), fistTalk)
	say("lumberjack", localize("FORBIDDEN_ZONE_INTRO_6"), talkToFist)
	say("fist", localize("FORBIDDEN_ZONE_INTRO_7"), fistTalk, onLevelIntroEnd)

end

function onIntroSpeech2()

	say("lumberjack", "Wait a sec. Brian? Who's Brian?", talkToFist)
	say("fist", "Erm. Nobody.", fistTalk)
	say("lumberjack", "You said you didn't know who was doing this!", talkToFist)
	say("fist", "I don't. Forget I said anything.", fistTalk)
	say("lumberjack", "TELL ME! NOW!", talkToFistAngry, eatHand)

--	game_manager:startTimer(3.0, eatHandReverse)
	--<Tim puts fist in his mouth>
	say("fist", "MMFFGGMMHHFFF!!", nil, function() eatHandReverse(); game_manager:startTimer(1.0, onIntroSpeech3) end)
end

function onIntroSpeech3()
	say("lumberjack", "Tell me or I'll find another place to put you!", talkToFist)
	say("fist", "Brian is my brother.", fistTalk)
	say("fist", "He used my inventions to take over the universe.")
	say("lumberjack", "Your inventions?! THIS IS YOUR FAULT?!", talkToFistAngry)
	say("fist", "A bit, but I'm trying to fix it!", fistTalk)
	say("lumberjack", "OH REALLY?! HOW'S THAT GOING THEN?!", talkToFistAngry)
	say("fist", "We need to find Brian and stop him.", fistTalk)
	say("lumberjack", "This is 100% the last time I help you.", talkToFist, connectControls)


--	connectControls()

end


function onAmbush(bIsRestart)

	-- Restart from here
	if (bIsRestart ~= true) then
    	
        -- Make this a bit harder than the last ambush
        bot_manager.MaxBotsOnScreen = bot_manager.MaxBotsOnScreen + 1

		game_manager:setCheckpoint("onAmbush")
	end

	-- Spawn regular enemies
	local bot_descs = {}
	table.insert(bot_descs, game_manager:actorDescWithFile("boba-gruntbear.plist"))

	-- Spawn lots of enemies
	startAmbush(bot_descs, bot_manager.MaxBotsOnScreen * 3)

	return true
	
end

function onBossAmbush(bIsRestart)

	-- Restart from here
	if (bIsRestart ~= true) then
		game_manager:setCheckpoint("onBossAmbush")
	end

	bot_manager.MaxBotsOnScreen = 3

	-- Spawn giant enemies
	for i=1,bot_manager.MaxBotsOnScreen * 2 do
		bot_desc = game_manager:actorDescWithFile("boba-gruntbear.plist")

		local bot_id = bot_manager:addBotToSpawnQueue(bot_desc, kSpawnDir_Right)
		bot_manager:triggerOnBotEvent(bot_id, kBotTrigger_Spawned, onGiantBotSpawned)
		bot_manager:triggerOnBotEvent(bot_id, kBotTrigger_Killed, checkStopCameraBlock)
	end

	return true

end

function onGiantBotSpawned(bot)

	bot:setScaleY(1.5)
	bot:setScaleX(bot:getScaleX() * 1.5)

end