home *** CD-ROM | disk | FTP | other *** search
/ Classic Fond 52 / ClassicFond52.iso / GAMES / DROIDW.RAR / DWCD.GOB / mission_cog_moisture_gear.cog < prev    next >
Encoding:
Text File  |  1998-11-04  |  1.6 KB  |  86 lines

  1. # Droids Cog Script
  2. #
  3. # b0_SafetyDoor.cog
  4. #
  5. # Two Switch door script for Biped obstacle course
  6. #
  7. # 10/23/97 [DGS]    Created 
  8. #        
  9. # ========================================================================================
  10.  
  11. symbols
  12.     message    startup        
  13.     message     activate
  14.     message    arrived        
  15.     
  16.     thing        screw0    linkid=1 
  17.     thing        screw1
  18.     thing        screw2
  19.     thing        screw3
  20.     
  21.     thing        platform    linkid=3 
  22.     
  23.     surface    Button0    linkid=2
  24.         
  25.     float        speed=2.0
  26.     
  27.     sector    doorSector    local
  28.     int        on_button=0    local
  29.     int        rotate    local
  30. end
  31.  
  32. # ========================================================================================
  33.  
  34. code
  35.  
  36. startup:
  37.     AttachThingToThing(screw1, screw0);
  38.     AttachThingToThing(screw2, screw0);
  39.     //AttachThingToThing(screw3, screw0);
  40.     
  41.     MoveToFrame(platform, 1, speed);
  42.     //RotatePivot(screw0, 1, 1);
  43.  
  44.     return;
  45.  
  46. # ........................................................................................
  47.  
  48. activate:
  49.     if (GetSenderId() == 2)     // Turn on the gear machine
  50.         {
  51.         if (GetCurFrame(platform)==1)
  52.             {
  53.             MoveToFrame(platform, 2, speed);
  54.             rotate = 1;
  55.             RotatePivot(screw0, 1, 1);
  56.             }
  57.  
  58.         if (GetCurFrame(platform)==2)
  59.             {
  60.             SkipToFrame(platform, 0, speed);
  61.             rotate = 1;
  62.             RotatePivot(screw0, 1, -1);
  63.             }
  64.         }
  65.      return;
  66.  
  67. # ........................................................................................
  68.  
  69. arrived:
  70.     if ((GetSenderId() == 1) && (rotate == 1))
  71.         {
  72.         RotatePivot(screw0, 1, 1);
  73.         }
  74.     if (GetSenderId() == 3)
  75.         {
  76.         RotatePivot(screw0, 1, 10000);
  77.         rotate = 0;
  78.         }
  79.     return;
  80.  
  81.  
  82.  
  83.  
  84. end
  85.  
  86.