level
{
	name "Level 05"
	number 05
	
	bonus time 70 // Initial bonus time, in seconds
	
	world
	{
		visitable
		{
			// Top floor
			min_max (-256,512,512) (255,1279,1535)				// Start hall
			min_max (-512,512,-512) (511,1279,511)				// Room in center
			min_max (-256,512,-1280) (255,1023,-513)			// Exit room
			min_max (-1280,512,-512) (-513,1279,-1)				// Path to the bubbles on left side
			min_max (-512,0,-512) (-257,511,255)					// Hole down to bottom floor on left
			min_max (512,0,-512) (767,1279,-1)						// Passage to right incl hole down to bottom floor
			min_max (768,512,-512) (1279,1279,511)				// Path to bubbles on the right
			
			// Bubble shafts
			min_max (768,-1536,512) (1279,1279,1535)			// Right of start
			min_max (-1280,-1536,-1536) (-769,1279,-513)	// Left of exit
			
			// Bottom floor
			min_max (-1280,-1024,768) (767,-257,1535)			// Room under start excl wall to rest of floor
			min_max (512,-1024,512) (767,-257,767)				// Corner btw bubbles and inner wall (not covered by above)
			min_max (-1024,-1536,1024) (-257,-1025,1279)	// Small hole with lava
			
			min_max (-1280,-1536,-256) (-513,-1,767)			// Volume containing bubble to wall (left of center)
			min_max (-512,-1536,-1536) (255,-1,511)				// Volume covering center
			min_max (256,-1536,-1536) (1279,-1,255)				// Volume covering bubble closest to exit
			min_max (-768,-1024,-1536) (-513,-1,-513)			// Where to jump of the bubbles closest to exit
		}
		
		not_visitable
		{
			// Bottom floor
			min_max (0,-1024,1280) (511,-257,1535)				// Pillar on outside wall (under start)
			
			min_max (-768,-1536,512) (255,-1,767)					// Wall under start
			min_max (-1280,-1536,-256) (-513,-769,255)		// Plateau after bubble
			
			min_max (-512,-1536,256) (-1,-769,511)				// 2x1 plateau att inner wall
			
			min_max (0,-1536,-256) (511,-769,255)					// Square in the center (almost)
			
			min_max (768,-1536,-256) (1279,-769,255)			// Squared plateau at wall
			min_max (1024,-1536,-1536) (1279,-769,-257)		// Small path along wall
			
			min_max (-256,-1536,-1536) (511,-1025,-1025)	// Path along wall after pillar
			min_max (-512,-1536,-1280) (-1,-1025,-769)		// Path leading from bubbles
			
			min_max (-512,-1024,-1536) (-257,-1,-1281)		// Pillar on outer wall (under exit)
		}
		
		exit // supports unlimited exits in the same level
		{
			min_max (-256,512,-1280) (255,1023,-769)
		}
		
		arrows
		{
			// If going right
			pos_dir (384,640,-512,x+)
			pos_dir (1280,640,-128,z+)
			pos_dir (896,128,1536,y-)
			pos_dir (896,-896,1536,x-)
			pos_dir (-1280,-896,896,z-)
			pos_dir (-896,-896,256,y+)
			pos_dir (-896,-640,-256,x+)
			pos_dir (1280,-640,128,z-)
			pos_dir (1152,-640,-1536,x-)
			pos_dir (-1280,-896,-896,y+)
			pos_dir (-1280,128,-896,z+)
			pos_dir (-896,640,0,x+)
			
			// If going left
			pos_dir (-384,640,-512,x-)
			pos_dir (-1280,640,-384,z-)
			pos_dir (-896,128,-1536,y-)
			pos_dir (-896,-896,-1536,x+)
			pos_dir (1024,-1152,-1152,y+)
			pos_dir (1280,-640,-1152,z+)
			pos_dir (896,-640,256,x-)
			pos_dir (-1280,-640,128,z+)
			pos_dir (-896,-896,1536,x+)
			pos_dir (1280,-896,896,y+)
			pos_dir (1280,128,896,z-)
			pos_dir (896,640,-512,x-)
		}
		
		start
		{
			pos (0,640,1280)
			angle (0,2048,0)  // Looking angle. 4096 = 360 degrees. Last angle (z) is unused
		}
	}
	
	lava
	{
		// start pos is now automatic
		delay 30000	// ms per raise of 8 units
	}
	
	bubbles
	{
    ascending   // Spawn point for ascending bubbles
		{
			start (1024,-1664,768)
      end 1152					// Bubbles will disappear when reaching this y-position
      delay 8000				// ms between spawning new bubble
      maxBubbles 4			// maximum bubbles existing at the same time from this spawn
		}
    ascending   // Spawn point for ascending bubbles
		{
			start (-1024,-1664,-768)
      end 1152					// Bubbles will disappear when reaching this y-position
      delay 8000				// ms between spawning new bubble
      maxBubbles 4			// maximum bubbles existing at the same time from this spawn
		}
		
		stopping   // Spawn point for stopping bubbles
		{
			start (-1024,-1664,512)
      end -128					// Bubbles will disappear when reaching this y-position
      delay 8000				// ms between spawning new bubble
      maxBubbles 3			// maximum bubbles existing at the same time from this spawn
		}
		stopping   // Spawn point for stopping bubbles
		{
			start (768,-1664,-1280)
      end -128					// Bubbles will disappear when reaching this y-position
      delay 8000				// ms between spawning new bubble
      maxBubbles 3			// maximum bubbles existing at the same time from this spawn
		}
		
		descending   // Spawn point for descending bubbles
		{
			start (1024,-1664,1280)
			end 1152					// Bubbles will disappear when reaching this y-position
			delay 8000			  // ms between spawning new bubble
			maxBubbles 4		  // maximum bubbles existing at the same time from this spawn
		}
		descending   // Spawn point for descending bubbles
		{
			start (-1024,-1664,-1280)
			end 1152					// Bubbles will disappear when reaching this y-position
			delay 8000			  // ms between spawning new bubble
			maxBubbles 4		  // maximum bubbles existing at the same time from this spawn
		}
	}
	
	emeralds 13
	{
		required 12
		pos (0,640,640)				// 0
		pos (0,640,-256)			// 1
		pos (1024,640,-256)		// 2
		pos (256,-896,1024)		// 3
		pos (-512,-896,896)		// 4
		pos (-896,-896,1408)	// 5
		pos (-768,-640,0)			// 6
		pos (256,-640,-128)		// 7
		pos (1024,-640,0)			// 8
		pos (1152,-640,-896)	// 9
		pos (256,-896,-1280)	// 10
		pos (-384,-896,-1024)	// 11
		pos (-1024,640,-256)	// 12
	}
}
