Ejemplo n.º 1
0
        public LightSource(Game1 game, XmlTextReader reader)
            : base(game, reader)
        {
            string pxStr2      = reader.GetAttribute("px");
            string pyStr2      = reader.GetAttribute("py");
            string angleStr    = reader.GetAttribute("angle");
            string switchOnStr = reader.GetAttribute("switchOn");

            float px2 = float.Parse(pxStr2);
            float py2 = float.Parse(pyStr2);

            if (angleStr != null)
            {
                this.angle = float.Parse(angleStr);
            }
            if (switchOnStr != null && switchOnStr == "false")
            {
                this.switchOn = false;
            }

            this.game                 = game;
            this.position             = new Vector2(px2, py2);
            this.lightRay             = new LightRay(game, Helper.ToVector2(CollisionRect.Center), angle);
            this.lightRay.LightSource = this;
        }
        public LightSource(Game1 game, XmlTextReader reader)
            : base(game, reader)
        {
            string pxStr2 = reader.GetAttribute("px");
            string pyStr2 = reader.GetAttribute("py");
            string angleStr = reader.GetAttribute("angle");
            string switchOnStr = reader.GetAttribute("switchOn");

            float px2 = float.Parse(pxStr2);
            float py2 = float.Parse(pyStr2);
            if (angleStr != null)
                this.angle = float.Parse(angleStr);
            if (switchOnStr != null && switchOnStr == "false")
                this.switchOn = false;

            this.game = game;
            this.position = new Vector2(px2, py2);
            this.lightRay = new LightRay(game, Helper.ToVector2(CollisionRect.Center), angle);
            this.lightRay.LightSource = this;
        }
Ejemplo n.º 3
0
 public LightSource(Game1 game, Vector2 pos)
     : base(game, pos)
 {
     this.lightRay             = new LightRay(game, Helper.ToVector2(CollisionRect.Center), angle);
     this.lightRay.LightSource = this;
 }
 public LightSource(Game1 game, Vector2 pos)
     : base(game, pos)
 {
     this.lightRay = new LightRay(game, Helper.ToVector2(CollisionRect.Center), angle);
     this.lightRay.LightSource = this;
 }