--called by the host at the start of a game, makes the objects in question
function initHost()
	terrain.callUpdate = 0--skip calling the update function
	terrain.callWithin = 0
	
	--stage.GFP("BLACK HOLE CRATE")
	--stage.createShip("Blackhole", "null", terrain.centerx, terrain.centery, 0)
	
	--black center
	--stage.createEmitter("blackhole", terrain.centerx, terrain.centery)
	--emitter.upload()
	
	--creates the hole in the center of the map, regardless of terrain placement
	stage.createShip("Blackhole", "null", terrain.centerx, terrain.centery, 0)
	ship.alpha = .95
	
	--black center
	stage.createEmitter("blackhole_under", terrain.centerx, terrain.centery)
	emitter.upload()
	
	stage.createEmitter("blackhole", terrain.centerx, terrain.centery)
	emitter.upload()
	
	--inward-coming sparklies
	stage.createEmitter("warp_sparklies", terrain.centerx, terrain.centery)
	emitter.num = -1
	emitter.movrotX = terrain.centerx
	emitter.movrotY = terrain.centery
	emitter.posVar = 420
	emitter.lifetimer = 1000
	emitter.alpha = .9
	emitter.setRGB(200,100,100)
	--emitter.upload()
	return 0
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()
	--pull the ship towards the center
	--dx = ship.x - terrain.centerx
	--dy = ship.y - terrain.centery
	--dist = math.sqrt(dx^2 + dy^2)
	--theta = math.deg(math.atan2(dy, dx)) + 180
	--force = (128 / (dist+1)) * 20
	--ship.add_force(theta, force)
	
	--kill ships at the center
	--if dist <= 25 then ship.armour = 0 end
	
	return 0
end


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