--called at the start of a game, makes the objects in question
function initHost()
	--make some asteroids to hide between
	terrain.vars.init("asteroidNum", math.random(4,8))
	for i = 1, terrain.vars.get("asteroidNum") do
		createAsteroid()
	end
	
	--create the inhibitor in question
	ax = terrain.x + math.random(0, terrain.wid)
	ay = terrain.y + math.random(0, terrain.het)
	
	--create the disguised alien
	stage.createShip("Barnacle", "null", terrain.centerx, terrain.centery, 7)
	ship.spin = (math.random() - .5) * 2
	
	--subtle aura
	stage.createEmitter("nebulaeaura")
	emitter.attach(ship)
	emitter.upload()
	
	terrain.callWithin = 0--skip calling the within function
	terrain.callUpdate = 0--skip calling the update function
	
	return 0
end


function createAsteroid()
	--randomize placement of the asteroid
	ax = terrain.x + math.random(0, terrain.wid)
	ay = terrain.y + math.random(0, terrain.het)
	
	--randomize size of the asteroid
	size = ""
	spin = math.random() - .5
	roll = math.random(1,21)
	if roll <= 10 then
		size = "Asteroid1"
		spin = spin * 6
	elseif roll > 10 and roll <= 20 then
		size = "Asteroid2"
		spin = spin * 3
	elseif roll == 21 then
		size = "Asteroid3"
	end
	
	--create the asteroid and bump it
	stage.createShip(size, "null", ax,ay,0)
	ship.spin = spin
	ship.bump(math.random(0,359), math.random(500, 3000))
	--ship.orbitx = terrain.centerx
	--ship.orbity = terrain.centery
	
	--tell the terrain to keep track of this asteroid for as long as it's alive
	--terrain.trackShip(ship)
end

--called (by the host) every loop
function updateHost()
	return 0
end

--called (by the host) when a ship is inside this terrain tile
function shipWithin()
	return 0
end

--sets the editor/minimap display icon and color
function setIcon()
	icon.frame = 20	--from map_icons.png, which frame to use.
	icon.color = 4	--brown
	return 0
end