home *** CD-ROM | disk | FTP | other *** search
/ Game Level Design / GLDesign.bin / Software / UnrealEngine2Runtime / UE2Runtime-22262001_Demo.exe / Gameplay / Classes / ViewShaker.uc < prev    next >
Text File  |  2003-12-11  |  2KB  |  47 lines

  1. //=============================================================================
  2. // ViewShaker:  Shakes view of any playercontrollers 
  3. // within the ShakeRadius
  4. //=============================================================================
  5. class ViewShaker extends Triggers;
  6.  
  7. //-----------------------------------------------------------------------------
  8. // Variables.
  9.  
  10. var() float ShakeRadius;            // radius within which to shake player views
  11. var() float ViewRollTime;            // how long to roll the instigator's view
  12. var() float RollMag;                // how far to roll view
  13. var() float RollRate;                // how fast to roll view
  14. var() float OffsetMagVertical;        // max view offset vertically
  15. var() float OffsetRateVertical;        // how fast to offset view vertically
  16. var() float OffsetMagHorizontal;    // max view offset horizontally
  17. var() float OffsetRateHorizontal;    // how fast to offset view horizontally
  18. var() float OffsetIterations;        // how many iterations to offset view
  19.  
  20.  
  21. //-----------------------------------------------------------------------------
  22. // Functions.
  23.  
  24. function Trigger( actor Other, pawn EventInstigator )
  25. {
  26.     local Controller C;
  27.     local vector OffsetMag, OffsetRate;
  28.  
  29.     OffsetMag = OffsetMagHorizontal * vect(1,1,0) + OffsetMagVertical * vect(0,0,1);
  30.     OffsetRate = OffsetRateHorizontal * vect(1,1,0) + OffsetRateVertical * vect(0,0,1);
  31.     for ( C=Level.ControllerList; C!=None; C=C.NextController )
  32.         if ( (PlayerController(C) != None) && (VSize(Location - PlayerController(C).ViewTarget.Location) < ShakeRadius) )        
  33.             C.ShakeView(ViewRollTime,RollMag,OffsetMag,RollRate,OffsetRate,OffsetIterations);
  34. }
  35.  
  36. defaultproperties
  37. {
  38.     ShakeRadius=+2000.0
  39.     OffsetMagVertical=10
  40.     OffsetRateVertical=400
  41.     OffsetMagHorizontal=0
  42.     OffsetRateHorizontal=353
  43.     OffsetIterations=+500.0
  44.     Texture=Texture'S_SpecialEvent'
  45. }
  46.  
  47.