level
{
	name "Level 04"
	number 04
	
	bonus time 80 // Initial bonus time, in seconds
	
	world
	{
		visitable
		{
			min_max (-384,-1536,-512) (1151,1791,1279)		// Start room
			min_max (640,-1024,-768) (1151,1535,-513)			// Passage to hall
			min_max (-1152,-1536,-1280) (1151,1535,-769)	// First part of hall
			min_max (-1152,-1536,-768) (-641,1535,1279)		// Second part of hall, leads to exit
			min_max (-1152,768,1280) (-641,1279,1791)			// Exit room
		}
		
		not_visitable
		{
			min_max (-384,768,768) (127,1023,1279)				// Start plateau
			min_max (128,256,-512) (639,511,-1)						// First plateau to fly to
			min_max (640,-256,512) (1151,-1,1279)					// Second plateau to fly to
			min_max (640,-1536,768) (1151,-769,1279)			// Plateau in corner
			min_max (640,-1536,-768) (1151,-1025,767)			// Path towards hall
			min_max (128,-1536,-512) (639,-1025,-1)				// Plateau to hide away from bird
			min_max (-1152,-512,-1280) (127,-257,-769)		// Plateau in hall before corner
			min_max (-1152,-1536,-1280) (-897,1535,-1025)	// Corner in hall
			min_max (-1152,-512,-768) (-641,-257,-513)		// Small plateau in hall after turn
			min_max (-1152,-256,0) (-641,255,511)					// Plateau in last hall on way to exit
			min_max (-1152,512,1024) (-641,767,1279)			// Plateau outside exit
		}
		
		exit // supports unlimited exits in the same level
		{
			min_max (-1152,768,1280) (-641,1279,1791)
		}
		
		arrows
		{
			pos_dir (512,640,-512,y-)
			pos_dir (768,-896,-1280,x-)
		}
		
		start
		{
			pos (-128,1152,1152)
			angle (0,2048,0)  // Looking angle. 4096 = 360 degrees. Last angle (z) is unused
		}
	}
	
	lava
	{
		// start pos is now automatic
		delay 20000	// ms per raise of 8 units
	}
	
	bubbles
	{
    ascending   // Spawn point for ascending bubbles
		{
			start (896,-1664,-1024)
      end 1408					// Bubbles will disappear when reaching this y-position
      delay 8000				// ms between spawning new bubble
      firstdelay 2000
      maxBubbles 4			// maximum bubbles existing at the same time from this spawn
		}
		descending   // Spawn point for descending bubbles
		{
			start (384,-1664,-1024)
			end 1408					// Bubbles will disappear when reaching this y-position
			delay 8000			  // ms between spawning new bubble
			firstdelay 4000
			maxBubbles 4		  // maximum bubbles existing at the same time from this spawn
		}
    ascending   // Spawn point for ascending bubbles
		{
			start (-896,-1664,-256)
      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
		}
    ascending   // Spawn point for ascending bubbles
		{
			start (-896,-1664,768)
      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
		}
	}
	
	emeralds 11
	{
		required 9
		pos (128,896,384)			// 0
		pos (640,640,384)			// 1
		pos (896,128,640)			// 2
		pos (896,-640,896)		// 3
		pos (896,-896,512)		// 4
		pos (896,-896,128)		// 5
		pos (-256,-128,-1024)	// 6
		pos (-768,-128,-896)	// 7
		pos (-896,-256,-256)	// 8
		pos (-896,384,256)		// 9
		pos (-896,128,768)		// 10
	}
	
	bird
	{
		pos (896,-896,-1024)
		pos (896,-896,512)
	}
	
	bonus_items
	{
		parachutes 3
		{
			pos (-128,1152,896)	// At start plateau
			pos (384,640,-256)	// At first plateau to fly to
			pos (896,128,1024)	// At second plateau to fly to
		}

		lavastopper (768,100,896)
	}	
}
