if oPlayer.y < spawnY + 500
{
	if lastBubble.x - 500 < 0
	{
		spawnX = random_range(200, lastBubble.x + 300);
	}
	else if lastBubble.x + 500 > 1000
	{
		spawnX = random_range(lastBubble.x - 300, 1000 - 200);
	}
	else
	{
		spawnX = random_range(lastBubble.x - 300, lastBubble.x + 300);
	}
	
	if irandom(5) == 1
	{
		lastBubble = instance_create_layer(spawnX, spawnY, "Instances", oEvilBubble);
	}
	else
	{
		lastBubble = instance_create_layer(spawnX, spawnY, "Instances", oBubble);
	}
	
	if irandom(8) == 1
	{
		instance_create_layer(950, spawnY - 150, "Instances", oLaserDuck);
	}
	else if irandom(4) == 1
	{
		instance_create_layer(-200, spawnY - 150, "Instances", oBacteria);
	}
	else if irandom(5) == 1
	{
		instance_create_layer(150, spawnY - 150, "Instances", oVirus);
	}
	
	spawnY -= spawnDistance;
}