level
{
	name "Level 08"
	number 08
	
	bonus time 140 // Initial bonus time, in seconds
	
	world
	{
		visitable
		{
			// First room
			min_max (768,-1024,1408) (1023,-1,1919)				// Start cave

			min_max (256,-1280,-1408) (1535,-1,1407)			// 1st room, bottom part
			min_max (0,0,-1408) (1535,1279,639)						// 1st room, upper part where ceiling is lower
			min_max (0,0,640) (1535,1535,1407)						// 1st room, upper part with higher ceiling
			
			// Small passage between 1st & 2nd room
			min_max (-256,512,1152) (-1,1279,1407)				// Lower step in corner
			min_max (-256,768,640) (-1,1279,1151)					// Path
			min_max (-256,768,384) (-1,1535,639)					// Passage to next room

			// Bigger passage where it is possible to se exit
			min_max (-256,-1280,-1408) (255,1023,-385)

			
			// Second room
			min_max (-1536,-1280,-1408) (-257,1279,639)
			
			// Exit room
			min_max (-1792,0,-1408) (-1537,1023,-385)			// Outer part
			min_max (-2304,0,-1408) (-1793,511,-385)			// Inner part
		}
		
		not_visitable
		{
			// First room
				// Lower part
			min_max (768,-1280,896) (1279,-1025,1151)			// 2x1 outside start
			min_max (256,-1280,384) (1279,-1025,639)				// Long part of L-shape (4x1)
			min_max (256,-1280,128) (511,-1025,383)				// Rest of L-shape, next to inner wall (1x1)
			min_max (512,-1280,-384) (767,-1025,127)				// 2x1 next to L-shape above
			min_max (1280,-1280,-128) (1535,-1025,127)			// Small part (1x1) of small L on right outer wall
			min_max (1024,-1280,-384) (1535,-1025,-129)		// Rest of L above (2x1)
			
				// Stair up
			min_max (1280,-1280,-1152) (1535,-1025,-641)		// Lowest step
			min_max (1024,-1280,-1152) (1279,-769,-897)		// Second step
			min_max (1024,-1280,-1408) (1279,-513,-1153)	// Third step
			min_max (768,-1280,-1408) (1023,-257,-1153)		// Fourth step
			min_max (256,-1280,-1408) (767,-1,-1153)			// Last step before up
			
				// Upper part
			min_max (0,0,-1408) (255,255,-641)						// Long part in L-shaped thing sticking out from wall
			min_max (256,0,-896) (511,255,-641)						// Rest of L-shape (1x1)
			min_max (768,0,-896) (1023,255,-385)					// 2x2 in mid-air
			min_max (512,0,-384) (767,255,-129)						// 1x1 in mid-air
			min_max (1280,0,-640) (1535,255,639)					// Path right of start
			min_max (1024,0,-384) (1279,255,-129)					// 1x1 sticking out from path above (on right)
			min_max (0,-1280,-384) (255,255,1407)					// Path left of start (inner wall)
			min_max (256,0,128) (511,255,383)							// 1x1 sticking out from middle of path on left of start
			min_max (512,0,384) (767,255,639)							// 1x1 left of 2x2 plateau (seen from start), both in the air
			min_max (768,0,640) (1279,255,1151)						// 2x2 plateau in the air in front of & above start
			min_max (1024,256,1152) (1535,511,1407)				// 2x1 right up of start in outer wall corner
			min_max (256,0,1152) (511,255,1407)						// Lonely step (lower) on outer wall, up left of start
			min_max (0,256,1152) (255,511,1407)						// Step (outer wall) to climb to passage to next room
		
			// Second room
			min_max (-512,-1280,384) (-257,767,639)				// Small plateau in corner where entering
		}
		
		exit // supports unlimited exits in the same level
		{
			min_max (-2304,0,-1408) (-1793,511,-385)
		}
		
		arrows
		{
			pos_dir (1152,-896,-896,x+)
			pos_dir (1536,-896,-512,z-)
			pos_dir (1536,384,-256,z+)
			pos_dir (384,384,1408,x-)
			pos_dir (128,640,1408,x-)
		}
		
		start
		{
			pos (896,-896,1792)
			angle (0,2048,0)  // Looking angle. 4096 = 360 degrees. Last angle (z) is unused
		}
	}
	
	lava
	{
		delay 60000
	}
	
	bubbles
	{
		ascending   // Spawn point for stopping bubbles
		{
			start (-1152,-1408,256)
			end 896						// Bubbles will disappear when reaching this y-position
			delay 10000				// ms between spawning new bubble
			firstdelay 8000		// ms until spawning first bubble 
			maxBubbles 4			// maximum bubbles existing at the same time from this spawn
		}
		descending   // Spawn point for stopping bubbles
		{
			start (-768,-1408,128)
			end 896						// Bubbles will disappear when reaching this y-position
			delay 12000				// ms between spawning new bubble
			firstdelay 6000		// ms until spawning first bubble 
			maxBubbles 4			// maximum bubbles existing at the same time from this spawn
		}
		stopping   // Spawn point for stopping bubbles
		{
			start (-1280,-1408,-128)
			end 896						// Bubbles will disappear when reaching this y-position
			delay 10000				// ms between spawning new bubble
			firstdelay 5000		// ms until spawning first bubble 
			maxBubbles 4			// maximum bubbles existing at the same time from this spawn
		}
		descending   // Spawn point for stopping bubbles
		{
			start (-512,-1408,-384)
			end 896						// Bubbles will disappear when reaching this y-position
			delay 12000				// ms between spawning new bubble
			maxBubbles 4			// maximum bubbles existing at the same time from this spawn
		}
		stopping   // Spawn point for stopping bubbles
		{
			start (-896,-1408,-512)
			end 896						// Bubbles will disappear when reaching this y-position
			delay 10000				// ms between spawning new bubble
			firstdelay 3000		// ms until spawning first bubble 
			maxBubbles 4			// maximum bubbles existing at the same time from this spawn
		}
		ascending   // Spawn point for stopping bubbles
		{
			start (-1280,-1408,-768)
			end 896						// Bubbles will disappear when reaching this y-position
			delay 12000				// ms between spawning new bubble
			firstdelay 9000		// ms until spawning first bubble 
			maxBubbles 4			// maximum bubbles existing at the same time from this spawn
		}
		descending   // Spawn point for stopping bubbles
		{
			start (-1024,-1408,-1152)
			end 896						// Bubbles will disappear when reaching this y-position
			delay 10000				// ms between spawning new bubble
			firstdelay 2000		// ms until spawning first bubble 
			maxBubbles 4			// maximum bubbles existing at the same time from this spawn
		}
	}
	
	emeralds 14
	{
		required 12
		// First room, bottom floor
		pos (1024,-896,512)
		pos (640,-896,0)
		pos (1152,-896,-256)
		pos (1408,-896,-1024)
		
		// First room, upper floor
		pos (384,384,1280)
		pos (128,384,-1024)
		pos (640,384,512)
		pos (1408,384,0)
		pos (896,384,-768)
		
		// Small passage to second room
		pos (-128,896,768)
		
		// Second room
		pos (-768,512,128)			// 1 des
		pos (-1280,256,-128)		// 3 stop
		pos (-512,0,-384)		// 2 des
		pos (-1024,-256,-1152)	// 4 des
	}
	
	bird	// Lower part of first room
	{
		loop
		pos (1280,-896,-640)
		pos (1280,-896,1024)
		pos (512,-896,1024)
		pos (512,-896,-640)
	}
	bird	// Upper part of first room
	{
		loop
		pos (256,384,-384)
		pos (1280,384,-384)
		pos (1280,384,896)
		pos (256,384,896)
	}
	
	bonus_items
	{
		parachutes 1
		{
			pos (-384,896,512)	// On small plateau before coming to bubbles
		}
	}	
}
