Example #1
0
 public Component(Engine engine)
 {
     Engine = engine;
       Disposed = false;
       Visible = true;
       drawOrder = 0;
 }
Example #2
0
        /// <summary>
        /// Loads and manages maps.
        /// </summary>
        /// <param name="game">Game reference.</param>
        /// <param name="mapPath">The relative path to the map.</param>
        public Level(Engine engine, string mapPath)
            : base(engine)
        {
            mapFilePath = mapPath;
              Lights = new List<EffectLight>();
              levelParticleEffects = new List<ParticleEffectComponent>();

              DrawOrder = (int)Global.Layers.Background;

              Engine.AddComponent(this);
        }
Example #3
0
        public Light(Engine engine)
            : base(engine)
        {
            light = new Light2D();

              light.Texture = Engine.Lighting.PointLightTexture;

              Engine.Lighting.Krypton.Lights.Add(light);

              Engine.AddComponent(this);
        }
        public ParticleEffectComponent(Engine engine, string effectName, Vector2 initialPosition)
            : base(engine)
        {
            DrawParticleEffect = true;
              particleEffectName = effectName;
              this.Position = initialPosition;

              particleEffect = Engine.Content.Load<ParticleEffect>(@"ParticleEffects\" + particleEffectName);
              particleEffect.LoadContent(Engine.Content);
              particleEffect.Initialise();

              DrawOrder = int.MaxValue - 1;

              Engine.AddComponent(this);
        }
Example #5
0
        public Player(Engine engine, Vector2 tilePosition)
            : base(engine, tilePosition)
        {
            DrawOrder = (int)Global.Layers.Player;

              AudioListener = new AudioListener();
              AudioListener.Position = new Vector3(Position, 0);

              light = new Light(engine);
              light.Color = Color.White;
              light.Fov = MathHelper.TwoPi;
              light.Position = Position;
              light.Range = 250;
              light.ShadowType = Krypton.Lights.ShadowType.Illuminated;

              Engine.AddComponent(this);
        }
Example #6
0
 public GravityLight(Engine engine, float gravityValue)
     : base(engine)
 {
     this.gravityValue = gravityValue;
       gravityVector = new Vector2(0.0f, gravityValue);
 }
Example #7
0
 public NullLight(Engine engine, List<EffectLight> worldLights)
     : base(engine)
 {
     WorldLights = worldLights;
 }
 public MovingPlatformPhysicsComponent(Engine engine, List<Vector2> gameWorldPositionList, float speed)
     : base(engine)
 {
 }
Example #9
0
 /// <summary>
 /// Constructs a new instance of krypton
 /// </summary>
 /// <param name="game">Your game object</param>
 /// <param name="effectAssetName">The asset name of Krypton's effect file, which must be included in your content project</param>
 public KryptonEngine(Engine engine, string effectAssetName)
     : base(engine)
 {
     this.mEffectAssetName = effectAssetName;
 }