level
{
	name "Level 09"
	number 09
	
	bonus time 120 // Initial bonus time, in seconds
	
	world
	{
		visitable
		{
			// Start room
			min_max (-896,-1280,0) (1151,1535,1791)				// The main start room
				// Passage with parachute opposite to exit
			min_max (1152,768,0) (1663,1279,255)					// Entrance
			min_max (1408,768,256) (1663,1279,767)				// Inner part
			min_max (1152,768,768) (1663,1279,1023)				// Out to plateau
				// Exit
			min_max (-1152,0,512) (-897,767,1279)					// Outer part
			min_max (-1664,0,512) (-1153,511,1279)				// Inner part, where the exit is
			
			// Other room
			min_max (-1664,-1280,-1792) (127,1279,-1)			// Main of the other room
			min_max (128,-768,-1280) (383,-257,-513)			// Cavity with emeralds
		}
		
		not_visitable
		{
			// Start/exit room
				// Lower parts
			min_max (-384,-1280,1280) (-129,-769,1535)		// Start place
			min_max (-896,-1280,1024) (-641,-1025,1535)		// Path at bottom under exit closest to start
			min_max (-896,-1280,256) (-641,-1025,767)			// Path at bottom under exit closest to other room
				// Middle parts
			min_max (128,-768,1536) (639,-513,1791)				// Rock sticking out from wall closest to start
			min_max (-896,-1280,1536) (-129,-257,1791)		// Path next to start (connected to start but higher)
			min_max (-896,-256,256) (-641,-1,1791)				// Path outside exit
			min_max (-896,-256,0) (-641,255,255)					// Step up (in fact down) next to exit
				// Upper parts
			min_max (128,512,1536) (639,767,1791)					// Path on wall closest to bubble
			min_max (-896,512,1536) (-129,767,1791)				// Path on same wall as above but in the corner
			min_max (-896,768,256) (-641,1023,1791)				// Path above exit
			min_max (-896,768,0) (127,1023,255)						// Path sticking out between room
			min_max (128,512,0) (383,767,255)							// Step down, small (1x1) sticking out from wall
			min_max (640,512,0) (1151,767,255)						// Path in corner leading to passage with parachute
			min_max (896,512,768) (1151,767,1023)					// Rock to jump parachute from towards exit
			min_max (896,512,1024) (1151,1535,1279)				// Rock next to bubble
			
			// Other room
				// Lower parts
			min_max (-1408,-1280,-256) (-641,-1025,-1)		// Around corner from exit
			min_max (-1664,-1280,-512) (-1409,-769,-1)		// Step up
			min_max (-1664,-1280,-1280) (-1409,-513,-513)	// Step up again, opposite to emerald hall
			min_max (-1408,-1280,-1280) (-1153,-769,-513)	// Last step before on path crossing over to emeralds
			min_max (-1152,-1280,-1024) (-129,-1025,-769)	// Path at bottom crossing over to emerald hall
			min_max (-1664,-1280,-1792) (-1409,-769,-1281)// Step down leading to corner far away from exit
			min_max (-1152,-1280,-1792) (-385,-769,-1537)	// Path on wall most far away
			min_max (-384,-1280,-1792) (127,-513,-1537)		// Step up in corner close to emerald hall
			min_max (-128,-1280,-1280) (127,-769,-513)		// Path outside (inc part of) emerald hall

			
				// Upper parts
			min_max (-128,256,-1536) (127,511,-513)				// Path above emerald hall
			min_max (-640,256,-1792) (-129,511,-1537)			// Path on wall
			min_max (-896,256,-1792) (-641,511,-257)			// Upper part of bridge
			min_max (-896,0,-512) (-641,255,-1)						// Lower part of bridge
			min_max (-1664,256,-1280) (-1409,511,-513)		// Rock on wall opposite of emerald hall
			min_max (-1408,256,-1024) (-1153,511,-769)		// Part to jump to/from sticking out rock above
		}
		
		arrows
		{
			pos_dir (-896,-896,1152,z-)
			pos_dir (-512,-1152,-768,x+)
			pos_dir (-1536,-640,-1792,x+)
			pos_dir (256,-640,-512,x-)
			pos_dir (128,640,-128,z-)
			pos_dir (-768,128,1792,x+)
			pos_dir (1152,-640,1408,y+)
			pos_dir (1152,384,1408,z+)
			pos_dir (1024,640,1792,x-)
		}
		
		exit // supports unlimited exits in the same level
		{
			min_max (-1664,0,512) (-1153,511,1279)
		}
		
		start
		{
			pos (-256,-640,1408)
			angle (0,2048,0)  // Looking angle. 4096 = 360 degrees. Last angle (z) is unused
		}
	}
	
	lava
	{
		delay 12000
	}
	
	bubbles
	{
    ascending   // Spawn point for ascending bubbles
		{
			start (-128,-1408,-256)
      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 (896,-1408,1536)
      end 1408					// 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 ascending bubbles
		{
			start (512,-1408,1024)
      end 1408					// Bubbles will disappear when reaching this y-position
      delay 6000				// ms between spawning new bubble
      maxBubbles 5			// maximum bubbles existing at the same time from this spawn
		}
    descending   // Spawn point for ascending bubbles
		{
			start (0,-1408,768)
      end 1408					// Bubbles will disappear when reaching this y-position
      delay 6000				// ms between spawning new bubble
      maxBubbles 5			// maximum bubbles existing at the same time from this spawn
		}
	}
	
	emeralds 14
	{
		required 12
		pos (-768,-896,-128)
		pos (-1536,-640,-1664)
		
		// Emerald hall
		pos (0,-640,-1152)
		pos (256,-640,-1152)
		pos (0,-640,-896)
		// lavastopper
		pos (0,-640,-640)
		pos (256,-640,-640)
		
		// Up, opposite to emerald hall
		pos (-1536,640,-1152)
		pos (-1536,640,-640)
		
		pos (-384,-128,1664)
		pos (896,-384,1536)
		pos (-256,896,1664)
		pos (-768,1152,128)
		pos (896,896,128)
	}
	
	bonus_items
	{
		parachutes 1
		{
			pos (1536,896,512)	// For gliding to exit (in passage opposite to exit)
		}
		
		lavastopper (-640,-640,-1664)
		lavastopper (256,-640,-896)
		lavastopper (0,640,-896)
		lavastopper (-768,384,128)
		lavastopper (384,-384,1664)
		lavastopper (384,896,1664)
		lavastopper (768,896,128)
	}	
}
