CortTest
Class RainDrops

source: e:\games\UnrealTournament\CortTest\Classes\RainDrops.uc
Core.Object
   |
   +--Engine.Actor
      |
      +--Engine.Effects
         |
         +--CortTest.RainDrops
Direct Known Subclasses:None

class RainDrops
extends Engine.Effects

//============================================ // RainDrops //============================================
Variables
 Effects d


Function Summary
 void HitWall(vector HitNormal, Actor HitWall)
     
// When a drop hits a wall or lands on the ground then create
// a small rain puddle effect
 void Landed(vector HitNormal)
     
// Same for Landed
 void PreBeginPlay()



Source Code


00001	//============================================
00002	// RainDrops
00003	//============================================
00004	class RainDrops expands Effects;
00005	var effects d;
00006	function PreBeginPlay()
00007	{
00008	  Super.PostBeginPlay();
00009	  // Make the rain actually fall :)
00010	  SetPhysics(PHYS_Falling);
00011	}
00012	// When a drop hits a wall or lands on the ground then create
00013	// a small rain puddle effect
00014	function HitWall( vector HitNormal, actor HitWall )
00015	{
00016	  Super.HitWall(HitNormal, HitWall);
00017	  // 60% chance that there will be a puddle left on the ground
00018	  // do this to keep performance up
00019	  if (Frand() < 0.8)
00020	Spawn(class'RainPuddle',,,Location);
00021	  Destroy();
00022	}
00023	// Same for Landed
00024	function Landed(vector HitNormal)
00025	{
00026	  Super.Landed(HitNormal);
00027	  if (Frand() < 0.8)
00028	Spawn(class'RainPuddle',,,Location);
00029	  Destroy();
00030	}
00031	
00032	defaultproperties
00033	{
00034		DrawType=DT_Sprite
00035		Style=STY_Translucent
00036	}

End Source Code