Пример #1
0
 /// <summary>
 /// Initializes a new instance of LightNode.
 /// </summary>
 public LightNode( Renderer renderer, SceneGraph sceneGraph, Matrix localTransform,
     float range, float intensity, Color lightColor)
     : base(renderer, sceneGraph)
 {
     Vector2 pos = Vector2.TransformCoordinate( new Vector2(), localTransform );
     light = renderer.RegisterNewLight( range, intensity, pos, lightColor );
 }
Пример #2
0
        public ExplodingProjectile( Renderer renderer, Vector2 startPos, Vector2 direction,
            Vector2 initialVelocity, Scene scene)
            : base(renderer, startPos, direction, initialVelocity)
        {
            lifetime = config.GetSetting<float>( "ExplodingProjectileTimer" );
            clusterSize = config.GetSetting<int>( "ExplodingProjectileClusterSize" );
            projectileDamage = config.GetSetting<float>( "ExplodingProjectileDamage" );
            speed = config.GetSetting<float>( "ExplodingProjectileSpeed" );

            mesh = renderer.CreateCircularMesh(Color.Black, 13.0f, 6 );

            light = renderer.RegisterNewLight( 200.0f, 1.0f, startPos, Color.Red );

            this.velocity = initialVelocity + direction * speed;

            this.scene = scene;
        }