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

  1. #
  2. # Droids Cog Script
  3. #
  4. # CC_Crystal.cog
  5. #
  6. #  This here thing creates  crystals on the FLY. 
  7. #
  8. # Desc: 
  9. # 03/22/98    [DGS] Created    
  10. #
  11. # --------------------------------------------------------------------------------
  12.  
  13.  
  14. symbols
  15. message            startup
  16. message         user0
  17. message            arrived
  18. thing            crystal_g
  19. template        crystal_t
  20. int                create_on_startup=0
  21. thing            crystal_o                local            
  22. end
  23.  
  24. ## Code Section
  25. code
  26. startup:
  27.     // If the var create_on_startup is set to true, this routine will create the crystal at startup
  28.     // and start it spinning. If that's the case, it should never recieve a user0 message (create) from
  29.     // another cog. In other words, crystals that are created on startup should not be atached to the Jawa cog.
  30.     if (create_on_startup != 0) call user0;
  31.     return;
  32.  
  33. user0:
  34.     // When this is called, it creates a crystal and starts it a spinnin'
  35.     crystal_o = creatething(crystal_t,crystal_g);
  36.     capturething(crystal_o);
  37.     rotatepivot(crystal_o,1,1);
  38.  
  39. arrived:
  40.    // This here keeps it spinnin' 
  41.    rotatepivot(crystal_o,1,1);
  42.     return;    
  43.  
  44. end
  45.  
  46.