level
{
	name "Level 07"
	number 07
	
	bonus time 100 // Initial bonus time, in seconds
	
	world
	{
		visitable
		{
			// The main room
			min_max (-768,-2048,-640) (767,-257,1151)		// Bottom, up to ceiling above start
			min_max (256,-256,-640) (767,1791,127)			// Upper part where the bubble is going
			min_max (-768,-256,-640) (-1,2047,127)			// Upper part outside exit
			min_max (-768,-256,128) (767,2047,1151)			// Upper part, above start
			
			// Caves, passages and other holes inside walls
				// Bottom, down left of start
			min_max (-1280,-1792,-384) (-769,-769,-129)	// hole into wall, left bottom, opposite to start
			min_max (-1280,-1536,-128) (-1025,-769,895)	// Hall inside wall, bottom left
			min_max (-1280,-1536,896) (-769,-769,1151)	// hole leading out of wall, left of start
			min_max (-1280,-2048,128) (-1025,-1537,383)	// First hole to fall down (inside wall)
			min_max (-1280,-2048,640) (-1025,-1537,895)	// Second hole to fall down
			min_max (-1024,-2048,128) (-769,-2049,383)	// First connection to main hall
			min_max (-1024,-2048,640) (-769,-2049,895)	// Second connection to main hall
			
				// Path to and including bonus room
			min_max (768,-1024,-640) (1023,-513,-129)		// Jump-off to go to bonus life
			min_max (1024,-1024,-896) (1279,-513,-385)	// First tunnel part (2 segments in walking direction)
			min_max (768,-1024,-1152) (1279,-513,-897)	// Next tunnel part, around corner, 2 high (2 segs in walk.dir)
			min_max (512,-1280,-1408) (767,-513,-897)		// Step down and to right (2 segs in walk.dir)
			min_max (0,-1280,-1408) (511,-513,-1153)		// Left around corner (2 segs in walk.dir)
			min_max (256,-1024,-1152) (511,-513,-897)		// Small hole next to the one above, for better camera positioning.
			min_max (-256,-1024,-1408) (-1,-513,-1153)	// Up to bonus room (1x2x1)
			min_max (-512,-1024,-1152) (-1,-257,-641)		// Bonus room
			
				// Upper, up left of start
			min_max (-1280,0,-640) (-769,511,-385)			// Enter here
			min_max (-1280,0,-384) (-1025,511,639)			// After turning left
			min_max (-1280,256,128) (-1025,767,1663)		// Up one step and to corner
			min_max (-1280,512,1408) (-769,1279,1663)		// First step after turn
			min_max (-1024,768,1408) (-513,1535,1663)		// ...up...
			min_max (-768,1024,1408) (-257,1791,1663)		// ...up...
			min_max (-512,1280,1408) (-1,2047,1663)			// Up!
			min_max (0,1280,1152) (255,2047,1663)				// Leads out
	
				// Exit room
			min_max (-1024,768,-1152) (-257,1279,-641)	// Outer part
			min_max (-1024,768,-1664) (-513,1279,-1153)	// Inner part (same as exit)
		}
		
		not_visitable
		{
			// Bottom
			min_max (-512,-1024,640) (-1,-769,1151)			// Start plateau
			min_max (-768,-2048,-640) (255,-1793,-385)	// path opposite to start, down at bottom
			min_max (-768,-2048,-384) (-513,-1793,-129)	// Corner stone to walk into wall, down left of start
			min_max (-768,-2048,896) (255,-1537,1151)		// Path under start
			min_max (512,-2048,128) (767,-1537,1151)		// Path from corner and along wall, down right of start
			min_max (256,-2048,-128) (767,-1537,127)		// Path closest to bubble, right of start
			
			// Upper part
			min_max (256,0,-128) (767,255,639)					// Plateau where to jump of bubble
			min_max (-768,0,896) (767,255,1151)					// Long path above start (side to side)
			min_max (-768,-256,640) (-1,-1,1151)				// Half plateau left above start
			min_max (-768,0,640) (-513,255,895)					// Square to jump from to make it over easier
			min_max (-768,-256,-640) (-1,-1,-385)				// Path to jump to above start, opposite side
			min_max (-256,1024,896) (255,1279,1151)			// Rock above start to jump from to reach exit room
		}
		
		exit // supports unlimited exits in the same level
		{
			min_max (-1024,768,-1664) (-513,1279,-1153)
		}
		
		arrows
		{
			pos_dir (-128,-1664,-640,x-)
			pos_dir (768,-1408,1024,z-)
			pos_dir (640,-1408,-640,y+)
			pos_dir (384,128,-640,x-)
			pos_dir (256,384,-256,z+)
			pos_dir (384,384,1152,x-)
			pos_dir (-768,384,512,z-)
			pos_dir (-640,128,-640,x-)
			pos_dir (-640,1408,-640,y-)
		}
		
		start
		{
			pos (-256,-640,896)
			angle (0,2048,0)  // Looking angle. 4096 = 360 degrees. Last angle (z) is unused
		}
	}
	
	lava
	{
		delay 15000
	}
	
	bubbles
	{
    ascending   // Spawn point for ascending bubbles
		{
			start (512,-2176,-384)
      end 1664					// 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 11
		// Bottom part
		pos (128,-1664,-512)
		pos (-1152,-1408,512)
		pos (640,-1408,1024)
		pos (512,-1024,-384)	// On the way up
		
		// Bonus room
		pos (-384,-896,-1024)
		pos (-128,-896,-1024)
		
		// Middle part
		pos (512,384,256)
		pos (-128,128,768)
		pos (-128,128,-512)
		pos (-1152,128,256)
		pos (-896,640,1536)
		pos (-256,1408,1536)
		pos (-128,1408,1024)
		
		// Upper part
		pos (-384,896,-768)	// By exit
	}
	
	bonus_items
	{
		parachutes 3
		{
			pos (-256,-768,512)		// In front of start plateau
			pos (640,384,1024)		// After coming up with bubble, in corner
			pos (-1152,128,-256)	// For gliding to exit (in hall)
		}
		
		extra life (-256,-896,-768)
	}	
}
