-----------------------------------------------------------------------------
-- Stage 1-7
-----------------------------------------------------------------------------    

function PostStage()
	
    EntGame.EnablePlayerControl(false);
    EntGame.ClearFlag(GF_READYTOSTART);
    EntGame.BindCameraToEntity("IntroCamera");
             
    end;    
    
-----------------------------------------------------------------------------    
-- Setup

function Setup()
    -- turn on the "Game running" menu - may not be needed for this game
    EntGame.PushMenu("MenuGameRunning");

    -- load world
    SetupWorld("Maps\\WorldRockyDesert\\RockyDesertCommon.ini", "Maps\\Stage1-7\\Stage1-7.ini","","");
    EntGame.CreatePlayerEntities();

    EntGame.SetGlobalDustColorInitial(1.0, 0.91, .85, .65);
    EntGame.SetGlobalDustColorFinal  (0.0, 0.91, .85, .65);
    
    EntGame.SetStageTimer(150);
    
    EntGame.LoadAnimal(AID_MEERKAT_M);
    animala=EntGame.SpawnAnimalOnPath(AID_MEERKAT_M, "MeerkatPath4", 0, ST_POPUP, 20000, 0, 0, 1);     
    animalb=EntGame.SpawnAnimalOnPath(AID_MEERKAT_M, "MeerkatPath6", 0, ST_POPUP, 20000, 0, 0, 1);     
    Animal.SetElvOffset(animalb, .6);
	animalc=EntGame.SpawnAnimalOnPath(AID_MEERKAT_M, "MeerkatPath8", 0, ST_POPUP, 20000, 0, 0, 1);     
    Animal.SetElvOffset(animalc, 7.5); 
	animald=EntGame.SpawnAnimalOnPath(AID_MEERKAT_M, "MeerkatPath11", 0, ST_POPUP, 20000, 0, 0, 1);     
    Animal.SetElvOffset(animald, .6);
 	animale=EntGame.SpawnAnimalOnPath(AID_MEERKAT_M, "MeerkatPath12", 0, ST_POPUP, 20000, 0, 0, 1);     
    Animal.SetElvOffset(animale,1.2);
	--animalf=EntGame.SpawnAnimalOnPath(AID_MEERKAT_M, "MeerkatPath22", 0, ST_WPT_RUN, 20000, 0, 0, .3);     
    
	StartupSequence("Music\\Verdure.ogg");
	
	EntGame.DestroyAllAnimals();

--S    Animal.SetState(animala, ST_GONE);    
--S    Animal.SetState(animalb, ST_GONE);
--S    Animal.SetState(animalc, ST_GONE);
--S    Animal.SetState(animald, ST_GONE);
--S    Animal.SetState(animale, ST_GONE);
--S    Animal.SetState(animalf, ST_GONE);
	
    end;

    
-----------------------------------------------------------------------------
function Part1()

	Camera.JumpToWaypoint(entCamera, "CamWptAA");
    Camera.SetSpeed(entCamera, 0.0, 0.1); 
    
    Script.WaitSec(2); 
    
	animal1=EntGame.SpawnAnimalOnPath(AID_MEERKAT_M, "MeerkatPath1", 0, ST_POPUP, 3, 0, 0, 1);     
    Animal.SetElvOffset(animal1, .5); 
    Animal.FaceEntity(animal1, entCamera);
    Animal.SetCoinMode(animal1, CM_SPAWNREL); 
    
    Script.WaitSec(2.5);     
    
	EntGame.SpawnAnimalOnPath(AID_MEERKAT_M, "MeerkatPath2", 0, ST_WPT_RUN, 8, 0, -.5, 1.2);   
	  
	Script.WaitSec(2);
		
	a = EntGame.SpawnAnimalOnPath(AID_MEERKAT_M, "MeerkatPath23", 1, ST_POPUP, 3, 0, 0, 1);
	Animal.SetElvOffset(a, -.2); 
    Animal.FaceEntity(a, entCamera);
    
   	Script.WaitSec(2);      
   
	animal2=EntGame.SpawnAnimalOnPath(AID_MEERKAT_M, "MeerkatPath10", 0, ST_POPUP, 3, 0, 0, 1);     
    Animal.SetElvOffset(animal2, .3); 
    Animal.FaceEntity(animal2, entCamera);
    Animal.SetCoinMode(animal2, CM_SPAWNREL); 
             
   	Script.WaitSec(2.5);        
           		 
	animal3=EntGame.SpawnAnimalOnPath(AID_MEERKAT_M, "MeerkatPath9", 0, ST_POPUP, 3, 0, 0, 1);     
    Animal.SetElvOffset(animal3, .1); 
    Animal.FaceEntity(animal3, entCamera);
    Animal.SetCoinMode(animal3, CM_SPAWNREL);  
    EntGame.SpawnAnimalOnPath(AID_MEERKAT_M, "MeerkatPath3", 0, ST_WPT_RUN, 5, 0, 0, 1);   

    Script.WaitSec(2);
    	
    a = EntGame.SpawnAnimalOnPath(AID_MEERKAT_M, "MeerkatPath23", 0, ST_POPUP, 3, 0, 0, 1);
	Animal.SetElvOffset(a, -.2); 
    Animal.FaceEntity(a, entCamera);
    
   	Script.WaitSec(2);  
   	 	  
	animal4=EntGame.SpawnAnimalOnPath(AID_MEERKAT_M, "MeerkatPath10", 0, ST_POPUP, 1, -2.8, 1.4, 1);     
    Animal.SetElvOffset(animal4, 1.7); 
    Animal.FaceEntity(animal4, entCamera);
    Animal.SetCoinMode(animal4, CM_SPAWNREL); 
 
    Script.WaitSec(1.5); 
    
    a = EntGame.SpawnAnimalOnPath(AID_MEERKAT_M, "MeerkatPath23", 1, ST_POPUP, 3, 0, 0, 1);
	Animal.SetElvOffset(a, -.2); 
    Animal.FaceEntity(a, entCamera);
    
    Script.WaitSec(1.5); 
       	 	   
	animal5=EntGame.SpawnAnimalOnPath(AID_MEERKAT_M, "MeerkatPath1", 0, ST_POPUP, 1.5, 0, 0, 1);     
    Animal.SetElvOffset(animal5, .5); 
    Animal.FaceEntity(animal5, entCamera);
    Animal.SetCoinMode(animal5, CM_SPAWNREL);
            
    Script.WaitSec(3);        
    	
	animal6=EntGame.SpawnAnimalOnPath(AID_MEERKAT_M, "MeerkatPath5", 0, ST_POPUP, 4, 0, 0, 1);     
    Animal.SetElvOffset(animal6, 1.8); 
    Animal.FaceEntity(animal6, entCamera);
    Animal.SetCoinMode(animal6, CM_SPAWNREL); 
        
    Script.WaitSec(1.0);
    
    a = EntGame.SpawnAnimalOnPath(AID_MEERKAT_M, "MeerkatPath23", 2, ST_POPUP, 3, 0, 0, 1);
	Animal.SetElvOffset(a, -.2); 
    Animal.FaceEntity(a, entCamera);
    
   	Script.WaitSec(2.5);   
   		   
	EntGame.SpawnAnimalOnPath(AID_MEERKAT_M, "MeerkatPath2", 0, ST_WPT_RUN, 8, 0, -.5, 1.5);      		
    EntGame.SpawnAnimalOnPath(AID_MEERKAT_M, "MeerkatPath3", 0, ST_WPT_RUN, 5, 0, 0, 1);     		
	animal7=EntGame.SpawnAnimalOnPath(AID_MEERKAT_M, "MeerkatPath10", 0, ST_POPUP, 3, 0, 0, 1);     
    Animal.SetElvOffset(animal7, .3); 
    Animal.FaceEntity(animal7, entCamera);
    Animal.SetCoinMode(animal7, CM_SPAWNREL);    		
    
  	Script.WaitSec(2); 
  	
  	a = EntGame.SpawnAnimalOnPath(AID_MEERKAT_M, "MeerkatPath23", 0, ST_POPUP, 3, 0, 0, 1);
	Animal.SetElvOffset(a, -.2); 
    Animal.FaceEntity(a, entCamera);
    
  	Script.WaitSec(1);
  	
  	a = EntGame.SpawnAnimalOnPath(AID_MEERKAT_M, "MeerkatPath23", 1, ST_POPUP, 3, 0, 0, 1);
	Animal.SetElvOffset(a, -.2); 
    Animal.FaceEntity(a, entCamera);
    
    Script.WaitSec(1.5);
    
    a = EntGame.SpawnAnimalOnPath(AID_MEERKAT_M, "MeerkatPath23", 2, ST_POPUP, 3, 0, 0, 1);
	Animal.SetElvOffset(a, -.2); 
    Animal.FaceEntity(a, entCamera);
    
  	Script.WaitSec(1.5);       
       		
	animal8=EntGame.SpawnAnimalOnPath(AID_MEERKAT_M, "MeerkatPath4", 0, ST_POPUP, 6, 0, 0, 1);     
    Animal.SetElvOffset(animal8, .1); 
    Animal.FaceEntity(animal8, entCamera); 
    Animal.SetCoinMode(animal8, CM_SPAWNREL);
     
    Script.WaitSec(2);
 
    a = EntGame.SpawnAnimalOnPath(AID_MEERKAT_M, "MeerkatPath23", 0, ST_POPUP, 3, 0, 0, 1);
	Animal.SetElvOffset(a, -.2); 
    Animal.FaceEntity(a, entCamera);
       
    Script.WaitSec(2);  
   		   
	animal9=EntGame.SpawnAnimalOnPath(AID_MEERKAT_M, "MeerkatPath9", 0, ST_POPUP, 3, 0, 0, 1);     
    Animal.SetElvOffset(animal9, .1); 
    Animal.FaceEntity(animal9, entCamera);
    Animal.SetCoinMode(animal9, CM_SPAWNREL);    		 
	EntGame.SpawnAnimalOnPath(AID_MEERKAT_M, "MeerkatPath7", 0, ST_WPT_RUN, 5, 0, 0, 1); 
    		
   	Script.WaitSec(4);
   		  	
	animal10=EntGame.SpawnAnimalOnPath(AID_MEERKAT_M, "MeerkatPath10", 0, ST_POPUP, 2, 0, 0, 1);     
    Animal.SetElvOffset(animal10, .3); 
    Animal.FaceEntity(animal10, entCamera);
    Animal.SetCoinMode(animal10, CM_SPAWNREL);   		
	animal11=EntGame.SpawnAnimalOnPath(AID_MEERKAT_M, "MeerkatPath8", 0, ST_POPUP, 5, 0, 0, 1);     
    Animal.SetElvOffset(animal11, 7.5); 
    Animal.FaceEntity(animal11, entCamera); 
    Animal.SetCoinMode(animal11, CM_SPAWNREL);   
     	                
    Script.WaitSec(1.5); 
    a = EntGame.SpawnAnimalOnPath(AID_MEERKAT_M, "MeerkatPath23", 2, ST_POPUP, 3, 0, 0, 1);
	Animal.SetElvOffset(a, -.2); 
    Animal.FaceEntity(a, entCamera);
    Script.WaitSec(1.5);
    
    animal12=EntGame.SpawnAnimalOnPath(AID_MEERKAT_M, "MeerkatPath1", 0, ST_POPUP, 2, 0, 0, 1);     
    Animal.SetElvOffset(animal12, .5); 
    Animal.FaceEntity(animal12, entCamera);
    Animal.SetCoinMode(animal12, CM_SPAWNREL);
     
    Script.WaitSec(2); 
    a = EntGame.SpawnAnimalOnPath(AID_MEERKAT_M, "MeerkatPath23", 0, ST_POPUP, 3, 0, 0, 1);
	Animal.SetElvOffset(a, -.2); 
    Animal.FaceEntity(a, entCamera);
    a = EntGame.SpawnAnimalOnPath(AID_MEERKAT_M, "MeerkatPath23", 1, ST_POPUP, 3, 0, 0, 1);
	Animal.SetElvOffset(a, -.2); 
    Animal.FaceEntity(a, entCamera);
    Script.WaitSec(2); 
        	
    animal13=EntGame.SpawnAnimalOnPath(AID_MEERKAT_M, "MeerkatPath10", 0, ST_POPUP, 1, -2.3, 1.6, 1);     
    Animal.SetElvOffset(animal13, 1.9); 
    Animal.FaceEntity(animal13, entCamera);
    Animal.SetCoinMode(animal13, CM_SPAWNREL);
    
    Script.WaitSec(3); 
           
    end;    

-----------------------------------------------------------------------------
function Part2()
 	    
    Camera.SetSpeed(entCamera, 3.0, 0.1);
	Camera.StopAtWaypoint(entCamera, "CamWptBB");       
	
	EntGame.SpawnAnimalOnPath(AID_MEERKAT_M, "MeerkatPath21", 0, ST_WPT_RUN, 0, 0, 0, 2.5);
	Script.WaitSec(1.5);
	EntGame.SpawnAnimalOnPath(AID_MEERKAT_M, "MeerkatPath21", 0, ST_WPT_RUN, 0, 0, -1.8, 2.3);
	Script.WaitSec(1.5);
	
	a = EntGame.SpawnAnimalOnPath(AID_MEERKAT_M, "MeerkatPath23", 2, ST_POPUP, 3, 0, 0, 1);
	Animal.SetElvOffset(a, -.2); 
    	
	EntGame.SpawnAnimalOnPath(AID_MEERKAT_M, "MeerkatPath21", 0, ST_WPT_RUN, 0, 0, 2.2, 2.2);			
 	Script.WaitSec(4);	
 	
	animala=EntGame.SpawnAnimalOnPath(AID_MEERKAT_M, "MeerkatPath4", 0, ST_POPUP, 6, 0, 0, 1);     
    Animal.SetElvOffset(animala, .1); 
    Animal.FaceEntity(animala, entCamera);
    Animal.SetCoinMode(animala, CM_SPAWNREL);
    
    Script.WaitSec(3);
   	
	end;  

-----------------------------------------------------------------------------
function Part3()
   	
    Camera.SetSpeed(entCamera, 3.0, 0.1);
	Camera.StopAtWaypoint(entCamera, "CamWptCC");     
	
	a = EntGame.SpawnAnimalOnPath(AID_MEERKAT_M, "MeerkatPath23", 2, ST_POPUP, 3, 0, 0, 1);
	Animal.SetElvOffset(a, -.2);
	Script.WaitSec(1);
	a = EntGame.SpawnAnimalOnPath(AID_MEERKAT_M, "MeerkatPath23", 3, ST_POPUP, 3, 0, 0, 1);
	Animal.SetElvOffset(a, -.2);	
	Script.WaitSec(.5);
	a = EntGame.SpawnAnimalOnPath(AID_MEERKAT_M, "MeerkatPath24", 0, ST_POPUP, 3, 0, 0, 1);
	Animal.SetElvOffset(a, -.2);
	Script.WaitSec(3.5);
		    
	animala=EntGame.SpawnAnimalOnPath(AID_MEERKAT_M, "MeerkatPath11", 0, ST_POPUP, 3, 0, 0, 1);     
    Animal.SetElvOffset(animala, .7); 
    Animal.FaceEntity(animala, entCamera);
    Animal.SetCoinMode(animala, CM_SPAWNREL); 
    	     
	Script.WaitSec(2);

	animalb=EntGame.SpawnAnimalOnPath(AID_MEERKAT_M, "MeerkatPath4", 0, ST_POPUP, 2, 0, 0, 1);     
    Animal.FaceEntity(animalb, entCamera); 

	Script.WaitSec(3);
	         
	animalc=EntGame.SpawnAnimalOnPath(AID_MEERKAT_M, "MeerkatPath6", 0, ST_POPUP, 4, 0, 0, 1);     
    Animal.SetElvOffset(animalc, .6); 
    Animal.FaceEntity(animalc, entCamera); 
    Animal.SetCoinMode(animalc, CM_SPAWNREL);
    	     
	Script.WaitSec(4);
	         
	animald=EntGame.SpawnAnimalOnPath(AID_MEERKAT_M, "MeerkatPath11", 0, ST_POPUP, 2.5, 0, 0, 1);     
    Animal.SetElvOffset(animald, .7); 
    Animal.FaceEntity(animald, entCamera);  
    Animal.SetCoinMode(animald, CM_SPAWNREL);
    	     	    
	Script.WaitSec(2);

	animale=EntGame.SpawnAnimalOnPath(AID_MEERKAT_M, "MeerkatPath8", 0, ST_POPUP, 5, 0, 0, 1);     
    Animal.SetElvOffset(animale, 7.7); 
    Animal.FaceEntity(animale, entCamera); 
    Animal.SetCoinMode(animale, CM_SPAWNREL);   
    
 	animalf=EntGame.SpawnAnimalOnPath(AID_MEERKAT_M, "MeerkatPath12", 0, ST_POPUP, 1.5, 0, 0, 1);     
    Animal.SetElvOffset(animalf,1.2); 
    Animal.FaceEntity(animalf, entCamera);
    Animal.SetCoinMode(animalf, CM_SPAWNREL);    	     	     
	              
 	Script.WaitSec(3.5);  
 	     
	animalg=EntGame.SpawnAnimalOnPath(AID_MEERKAT_M, "MeerkatPath4", 0, ST_POPUP, 2, 0, 0, 1);     
    Animal.FaceEntity(animalg, entCamera); 	      

    Script.WaitSec(3.5); 
    	         
	animala=EntGame.SpawnAnimalOnPath(AID_MEERKAT_M, "MeerkatPath11", 0, ST_POPUP, 3, 0, 0, 1);     
    Animal.SetElvOffset(animala, .7); 
    Animal.FaceEntity(animala, entCamera);
    Animal.SetCoinMode(animala, CM_SPAWNREL);
    
    Script.WaitSec(2);      
     	 
	animalc=EntGame.SpawnAnimalOnPath(AID_MEERKAT_M, "MeerkatPath6", 0, ST_POPUP, 4, 0, 0, 1);     
    Animal.SetElvOffset(animalc, .6); 
    Animal.FaceEntity(animalc, entCamera); 
    Animal.SetCoinMode(animalc, CM_SPAWNREL);  
    
    Script.WaitSec(1.5); 
    	          	  
	animalg=EntGame.SpawnAnimalOnPath(AID_MEERKAT_M, "MeerkatPath4", 0, ST_POPUP, 2, 0, 0, 1);      
    Animal.FaceEntity(animalg, entCamera);

    Script.WaitSec(1.5);
         	     
	EntGame.SpawnAnimalOnPath(AID_MEERKAT_M, "MeerkatPath13", 0, ST_WPT_RUN, 4, .5, .5, 1.5);   
	
   	Script.WaitSec(1); 
   	 	 
    Camera.SetTiltOffset(entCamera, -15, .5); --Camera Tilt   
    
    Script.WaitSec(2);  
      	 	 	    
    Camera.SetTiltOffset(entCamera, 0, 1); --Camera Tilt
            	     
    end;  

-----------------------------------------------------------------------------
function Part4()
            	 
    Camera.SetSpeed(entCamera, 2.0, 0.1);
	Camera.StopAtWaypoint(entCamera, "CamWptDD");     
	
	EntGame.SpawnAnimalOnPath(AID_MEERKAT_M, "MeerkatPath22", 0, ST_WPT_RUN, 0, 0, 0, 2); 
	
   	Script.WaitSec(1.5);
   	 	 	    
	EntGame.SpawnAnimalOnPath(AID_MEERKAT_M, "MeerkatPath22", 0, ST_WPT_RUN, 0, -1, 0, 1.8);

	Script.WaitSec(1.0);
   	 	 	    
	EntGame.SpawnAnimalOnPath(AID_MEERKAT_M, "MeerkatPath22", 0, ST_WPT_RUN, 0, 1, -.5, 1.7);	

	Script.WaitSec(9.5);
			 		 
    -- pan right and shoot some more
    Camera.SetPanOffset(entCamera, 90, 0.5); --(25 is angle, .15 is turning speed)
	animal1=EntGame.SpawnAnimalOnPath(AID_MEERKAT_M, "MeerkatPath4", 0, ST_POPUP, 3, 0, 0, 1);     
    Animal.FaceEntity(animal1, entCamera);
    Animal.SetCoinMode(animal1, CM_SPAWNREL); 	     
    Script.WaitSec(3.5);
    
    -- pan left and shoot some more
    Camera.SetPanOffset(entCamera, -100, 0.5);
    Camera.SetTiltOffset(entCamera, 20, .5);      
	animal2=EntGame.SpawnAnimalOnPath(AID_MEERKAT_M, "MeerkatPath6", 0, ST_POPUP, 2.5, 0, 0, 1);     
    Animal.SetElvOffset(animal2, .6); 
    Animal.FaceEntity(animal2, entCamera); 
    Animal.SetCoinMode(animal2, CM_SPAWNREL);    
    Script.WaitSec(3);
 
    Camera.SetSpeed(entCamera, 2.0, 0.1);
	Camera.StopAtWaypoint(entCamera, "CamWptEE");   
	         
    -- pan back to the center
    Camera.SetPanOffset(entCamera, 0, 2);
    Camera.SetTiltOffset(entCamera, 0, 1.5); 
    
	Script.WaitSec(2);
	
	EntGame.SpawnAnimalOnPath(AID_MEERKAT_M, "MeerkatPath7", 0, ST_WPT_RUN, 5, 0, 0, 2.5);
	 	
	Script.WaitSec(.5);
		 		 
	EntGame.SpawnAnimalOnPath(AID_MEERKAT_M, "MeerkatPath7", 0, ST_WPT_RUN, 5, 0, -1.5, 2.0);
	
	Script.WaitSec(1);

	EntGame.SpawnAnimalOnPath(AID_MEERKAT_M, "MeerkatPath7", 0, ST_WPT_RUN, 5, 0, -.75, 2.2);
			 		 	
	Script.WaitSec(2);

	EntGame.SpawnAnimalOnPath(AID_MEERKAT_M, "MeerkatPath22", 0, ST_WPT_RUN, 0, 0, 0, 2); 
	
   	Script.WaitSec(1);
   	 	 	    
	EntGame.SpawnAnimalOnPath(AID_MEERKAT_M, "MeerkatPath22", 0, ST_WPT_RUN, 0, -1, 0, 1.8);

	Script.WaitSec(.8);
   	 	 	    
	EntGame.SpawnAnimalOnPath(AID_MEERKAT_M, "MeerkatPath22", 0, ST_WPT_RUN, 0, 1, -.5, 1.0);

	Script.WaitSec(1.2);	
	   	 	 	
	EntGame.SpawnAnimalOnPath(AID_MEERKAT_M, "MeerkatPath22", 0, ST_WPT_RUN, 0, -1.5, -1.5, 1.6); 
	
	Script.WaitSec(5);
		 		 
    -- pan right and shoot some more
    Camera.SetPanOffset(entCamera, 55, 0.5); --(25 is angle, .15 is turning speed)
    Camera.SetTiltOffset(entCamera, 10, .5);      
	animal3=EntGame.SpawnAnimalOnPath(AID_MEERKAT_M, "MeerkatPath8", 0, ST_POPUP, 5, 0, 0, 1);     
    Animal.SetElvOffset(animal3, 7.8); 
    Animal.FaceEntity(animal3, entCamera); 
    Animal.SetCoinMode(animal3, CM_SPAWNREL);	     
    Script.WaitSec(3);
    
    end;
        
-----------------------------------------------------------------------------
function Part5()
        		 		
    Camera.SetSpeed(entCamera, 3.0, 1.0);
	Camera.StopAtWaypoint(entCamera, "CamWptFF");   
	         
    -- pan back to the center
    Camera.SetPanOffset(entCamera, 0, 2);
    Camera.SetTiltOffset(entCamera, 0, 1.5); 

	EntGame.SpawnAnimalOnPath(AID_MEERKAT_M, "MeerkatPath22", 0, ST_WPT_RUN, 0, 0, 0, 1.2); 
	
   	Script.WaitSec(1);
   	 	 	    
	EntGame.SpawnAnimalOnPath(AID_MEERKAT_M, "MeerkatPath22", 0, ST_WPT_RUN, 0, -1, 0, 1.1);

	Script.WaitSec(.8);
   	 	 	    
	EntGame.SpawnAnimalOnPath(AID_MEERKAT_M, "MeerkatPath22", 0, ST_WPT_RUN, 0, 1, -.5, .9);
    
	Script.WaitSec(1.2);	
	
	a = EntGame.SpawnAnimalOnPath(AID_MEERKAT_M, "MeerkatPath24", 1, ST_POPUP, 5, 0, 0, 1);
	Animal.SetElvOffset(a, -.2);
	     
    Script.WaitSec(6);    

	animalg=EntGame.SpawnAnimalOnPath(AID_MEERKAT_M, "MeerkatPath4", 0, ST_POPUP, 4, 0, 0, 1);     
    Animal.FaceEntity(animalg, entCamera);

    Script.WaitSec(3);    
 
	animal1=EntGame.SpawnAnimalOnPath(AID_MEERKAT_M, "MeerkatPath1", 0, ST_POPUP, 3, 0, 0, 1);     
    Animal.SetElvOffset(animal1, .1); 
    Animal.FaceEntity(animal1, entCamera);
    Animal.SetCoinMode(animal1, CM_SPAWNREL); 
    
    a = EntGame.SpawnAnimalOnPath(AID_MEERKAT_M, "MeerkatPath24", 2, ST_POPUP, 5, 0, 0, 1);
	Animal.SetElvOffset(a, -.2);
	
    Script.WaitSec(2);    

    a = EntGame.SpawnAnimalOnPath(AID_MEERKAT_M, "MeerkatPath24", 3, ST_POPUP, 3, 0, 0, 1);
	Animal.SetElvOffset(a, -.2);
	
	EntGame.SpawnAnimalOnPath(AID_MEERKAT_M, "MeerkatPath21", 0, ST_WPT_RUN, 0, 0, 0, 2.5);
	Script.WaitSec(1.1);
	a = EntGame.SpawnAnimalOnPath(AID_MEERKAT_M, "MeerkatPath23", 0, ST_POPUP, 3, 0, 0, 1);
	Animal.SetElvOffset(a, -.2);
	EntGame.SpawnAnimalOnPath(AID_MEERKAT_M, "MeerkatPath21", 0, ST_WPT_RUN, 0, 0, -1.8, 2.3);
	Script.WaitSec(1.8);
	a = EntGame.SpawnAnimalOnPath(AID_MEERKAT_M, "MeerkatPath24", 2, ST_POPUP, 3, 0, 0, 1);
	Animal.SetElvOffset(a, -.2);
	EntGame.SpawnAnimalOnPath(AID_MEERKAT_M, "MeerkatPath21", 0, ST_WPT_RUN, 0, 0, 2.2, 2.2);			
 	Script.WaitSec(2);
 	a = EntGame.SpawnAnimalOnPath(AID_MEERKAT_M, "MeerkatPath23", 1, ST_POPUP, 3, 0, 0, 1);
	Animal.SetElvOffset(a, -.2);
	Script.WaitSec(2);
	EntGame.SpawnAnimalOnPath(AID_MEERKAT_M, "MeerkatPath2", 0, ST_WPT_RUN, 8, 0, -.5, 1.2);   
	  
   	Script.WaitSec(2);
 	a = EntGame.SpawnAnimalOnPath(AID_MEERKAT_M, "MeerkatPath23", 2, ST_POPUP, 3, 0, 0, 1);
	Animal.SetElvOffset(a, -.2);  		
	animalg=EntGame.SpawnAnimalOnPath(AID_MEERKAT_M, "MeerkatPath4", 0, ST_POPUP, 4, 0, 0, 1);     
    Animal.FaceEntity(animalg, entCamera);
	 	
    Script.WaitSec(3);
    a = EntGame.SpawnAnimalOnPath(AID_MEERKAT_M, "MeerkatPath23", 1, ST_POPUP, 3, 0, 0, 1);
	Animal.SetElvOffset(a, -.2);
    Script.WaitSec(3); 
    a = EntGame.SpawnAnimalOnPath(AID_MEERKAT_M, "MeerkatPath24", 3, ST_POPUP, 3, 0, 0, 1);
	Animal.SetElvOffset(a, -.2);
    a = EntGame.SpawnAnimalOnPath(AID_MEERKAT_M, "MeerkatPath23", 2, ST_POPUP, 3, 0, 0, 1);
	Animal.SetElvOffset(a, -.2);	
    Script.WaitSec(3);  
    a = EntGame.SpawnAnimalOnPath(AID_MEERKAT_M, "MeerkatPath24", 0, ST_POPUP, 3, 0, 0, 1);
	Animal.SetElvOffset(a, -.2);
    Script.WaitSec(1);
    a = EntGame.SpawnAnimalOnPath(AID_MEERKAT_M, "MeerkatPath24", 2, ST_POPUP, 3, 0, 0, 1);
	Animal.SetElvOffset(a, -.2);
	
	animal2=EntGame.SpawnAnimalOnPath(AID_MEERKAT_M, "MeerkatPath10", 0, ST_POPUP, 3, 0, 0, 1);     
    Animal.SetElvOffset(animal2, .3); 
    Animal.FaceEntity(animal2, entCamera);
    Animal.SetCoinMode(animal2, CM_SPAWNREL); 
                    		                       	    		  
    end;    

-----------------------------------------------------------------------------
-- Main entry point
   
Setup();   
Part1();   
Part2(); 
Part3(); 
Part4();
Part5();