示例#1
0
        public Normal()
        {
            _hp = 10;

            _proximity = new Proximity();

            Random rand    = new Random();
            int    randomX = rand.Next(-200, 1110);
            int    randomY = rand.Next(-200, 750);

            if (randomX <= 960 && randomX >= -50)
            {
                if (randomY > 550 || randomY < -50)
                {
                    position = new Position(randomX, randomY);
                }
                else
                {
                    position = new Position(randomX, -200);
                }
            }
            else
            {
                position = new Position(randomX, randomY);
            }

            XmlReaderWriter file = new XmlReaderWriter();

            file.OpenRead("Preference.xml");

            int width  = Int32.Parse(file.FindReadNode("width"));
            int height = Int32.Parse(file.FindReadNode("height"));

            _soundVolume = float.Parse(file.FindReadNode("SFXvolume"));
            _soundPitch  = float.Parse(file.FindReadNode("SFXpitch"));
            _soundPan    = float.Parse(file.FindReadNode("pan"));


            file.ReadClose();

            timeBeforeSoundPlay = rand.Next(0, 20000);

            limit = new Vector2(width + _width, height + _height);
        }
示例#2
0
 public ChainSaw()
 {
     proximity = new Proximity();
     LoadPreferenceData();
 }