level
{
	name "Level 03"
	number 03

	bonus time 80 // Initial bonus time, in seconds

	world
	{
		visitable
		{
			min_max (-1024,-1280,384) (1023,1535,1407)		// Part of level that has same ceiling height as start
			min_max (-1024,-1280,-1408) (-1,1279,383)			// Part of level that has second highest ceiling
			min_max (0,-1280,-1408) (1023,1023,-385)			// Third highest but not including inside of tower.
			min_max (256,-1024,-384) (1023,1023,127)			// Inside of tower
			min_max (512,-256,1408) (1023,255,1919)				// Exit room
		}
		
		not_visitable
		{
			min_max (-1024,-1280,896) (511,-769,1407)			// Start plateau
			// Pillars between start and exit (2x2)
			min_max (0,-768,1152) (255,255,1407)					// Closest to start, next to wall (4 high)
			min_max (0,-768,896) (255,511,1151)						// Closest start, not next to wall (5 high)
			min_max (256,-768,1152) (511,511,1407)				// Closest to exit, next to wall (5 high)
			min_max (256,-768,896) (511,-257,1151)				// Closest to exit, not next to wall	(2 high)
						
			min_max (-512,-1280,-384) (-1,-769,383)				// Plateau to jump to after start
			min_max (-512,-1280,-640) (-257,-769,-385)		// Small part sticking out from plateau above
			
			min_max (-512,-1280,-1408) (255,-769,-897)		// Plateau after second jump
			min_max (-1024,-1280,-1408) (-513,-769,-1153)	// Part sticking out from plateau into corner
			
			min_max (768,-1280,-1408) (1023,-257,-897)		// Small plateau to jump to from buble in corner
			
			// Blocks leading into "tower"
			min_max (768,-256,-896) (1023,-1,-385)				// +1 (= 1 block higher up)
			min_max (768,0,-384) (1023,255,127)						// +2
			min_max (512,-256,-128) (767,-1,127)					// +1
			min_max (256,-1024,-128) (511,-257,127)				// 0
			min_max (256,-1024,-384) (511,-513,-129)			// -1
			min_max (512,-1024,-384) (767,-769,-129)			// -2
			// The floor one more down in not included in the "inside of tower" visitable volume.

			min_max (-1024,0,-1408) (255,255,-897)				// Up on second level before cliffs sticking out.
			
			// Cliffs sticking out from wall (to jump on)
			min_max (-1024,0,-640) (-513,255,-385)
			min_max (-1024,0,-128) (-513,255,127)
			min_max (-1024,0,384) (-513,255,639)
			
			min_max (-1024,0,896) (-1,255,1407)						// Plateau over start (4x2x1)
			min_max (512,-1280,896) (1023,-257,1407)			// Plateau outside (under, in front of) exit
			min_max (256,512,896) (1023,767,1407)					// Plateau over exit
		}
		
		exit // supports unlimited exits in the same level
		{
			min_max (512,-256,1408) (1023,255,1919)
		}
		
		arrows
		{
			pos_dir (0,-640,1024,z-)
			pos_dir (-384,-640,-1408,x+)
			pos_dir (768,-896,-1024,y+)
			pos_dir (1024,-128,-1024,z-)
			pos_dir (640,-128,-1408,y+)
			pos_dir (640,384,-1408,x-)
			pos_dir (-1024,384,-1024,z+)
			pos_dir (-640,384,1408,x+)
			pos_dir (1024,896,1024,z-)
			pos_dir (640,896,384,y-)
			pos_dir (640,384,384,x+)
			pos_dir (1024,128,768,z+)
		}
		
		start
		{
			pos (-768,-640,1152)
			angle (0,1024,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 (512,-1408,-1152)
      end 896						// Bubbles will disappear when reaching this y-position
      delay 16000				// ms between spawning new bubble
      maxBubbles 4			// maximum bubbles existing at the same time from this spawn
		}
		
		stopping   // Spawn point for ascending bubbles
		{
			start (-256,-1408,640)
			end 1408				// Bubbles will disappear when reaching this y-position
			delay 8000      // ms between spawning new bubble
			firstdelay 2000	// ms until spawning first bubble
			maxBubbles 2    // maximum bubbles existing at the same time from this spawn
		}
		
		descending   // Spawn point for descending bubbles
		{
			start (768,-1408,640)
			end 1408					// Bubbles will disappear when reaching this y-position
			delay 8000			  // ms between spawning new bubble
			maxBubbles 2		  // maximum bubbles existing at the same time from this spawn
		}
	}

	emeralds 18
	{
		required 10
		pos (-256,-640,1152)	// 0
		pos (-256,-640,128)		// 1
		pos (-896,-640,-1280)	// 2
		pos (896,-128,-1152)	// 3
		pos (896,384,-128)		//x 4
		pos (640,128,0)				//x 5
		pos (384,-128,0)			//x 6
		pos (384,-384,-256)		//x 7
		pos (640,-640,-256)		//x 8
		pos (896,-896,-256)		//x 9
		pos (896,-896,0)			//x 10
		pos (640,-896,0)			//x 11
		pos (-256,384,-1152)	// 12
		pos (-768,384,-512)		// 13
		pos (-768,384,0)			// 14
		pos (-768,384,512)		// 15
		pos (0,384,1280)			// 16
		pos (768,896,1152)		// 17
	}
}