Esempio n. 1
0
 public void Update(Light light)
 {
     _source = light;
     _drawRectangle = light.DrawRectangle;
     int width = light.DrawRectangle.Width - 64;
     int height = light.DrawRectangle.Height - 64;
     _drawRectangle.X += (light.DrawRectangle.Width - width) / 2;
     _drawRectangle.Y += (light.DrawRectangle.Height - height) / 2;
     _drawRectangle.Width = width;
     _drawRectangle.Height = height;
 }
Esempio n. 2
0
 public Glow(Light light)
 {
     _texture = GameWorld.SpriteSheet;
     _drawRectangle = light.DrawRectangle;
     int width = light.DrawRectangle.Width - 64;
     int height = light.DrawRectangle.Height - 64;
     _drawRectangle.X += (light.DrawRectangle.Width - width) / 2;
     _drawRectangle.Y += (light.DrawRectangle.Height - height) / 2;
     _drawRectangle.Width = width;
     _drawRectangle.Height = height;
     _sourceRectangle = new Rectangle(20 * 16, 15 * 16, 64, 64);
     Color = light.Color;
     _source = light;
 }
Esempio n. 3
0
 public void CreateLavaParticle(Liquid lava, GameWorld map)
 {
     CurrentParticle = ParticleType.Lava;
     //texture = ContentHelper.LoadTexture("Effects/lava");
     Texture = GameWorld.ParticleSpriteSheet;
     CollRectangle = new Rectangle(lava.GetCollRectangle().Center.X - 8, lava.GetCollRectangle().Center.Y - 8, 8, 8);
     SourceRectangle = new Rectangle(0, 0, 8, 8);
     Velocity.Y = -10f;
     Position = new Vector2(CollRectangle.X, CollRectangle.Y);
     Opacity = 1f;
     light = new Lights.DynamicPointLight(this, 1, true, Color.Orange, .3f);
     GameWorld.Instance.LightEngine.AddDynamicLight(light);
 }