Example #1
0
        //Obtient les limites de l'écran de jeu
        public void GetLimit()
        {
            XmlReaderWriter file = new XmlReaderWriter();

            file.OpenRead("Preference.xml");

            positionEnd.X = Int32.Parse(file.FindReadNode("width"));
            positionEnd.Y = Int32.Parse(file.FindReadNode("height"));

            file.ReadClose();
        }
Example #2
0
        public void loadSoundSettings()
        {
            XmlReaderWriter file = new XmlReaderWriter();

            file.OpenRead("Preference.xml");
            _soundVolume = float.Parse(file.FindReadNode("SFXvolume"));
            _soundPitch  = float.Parse(file.FindReadNode("SFXpitch"));
            _soundPan    = float.Parse(file.FindReadNode("pan"));
            file.ReadClose();
            _weapon.LoadPreferenceData();
        }
Example #3
0
        public void LoadPreferenceData()
        {
            XmlReaderWriter file = new XmlReaderWriter();

            file.OpenRead("Preference.xml");

            brightness = Int32.Parse(file.FindReadNode("brightness"));
            bgm.Volume = float.Parse(file.FindReadNode("Mvolume"));
            contrast   = Int32.Parse(file.FindReadNode("contrast"));

            file.ReadClose();
        }
Example #4
0
 public void pause(bool state)
 {
     if (state)
     {
         bgm.Pause();
     }
     else
     {
         XmlReaderWriter file = new XmlReaderWriter();
         file.OpenRead("Preference.xml");
         bgm.Volume = float.Parse(file.FindReadNode("Mvolume"));
         file.ReadClose();
         bgm.Play();
     }
 }
Example #5
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);
        }
Example #6
0
        public void reset()
        {
            observers = new List <Monster>();
            _hp       = 100;
            _kill     = 0;
            XmlReaderWriter file = new XmlReaderWriter();

            file.OpenRead("Preference.xml");

            limit = new Vector2(Int32.Parse(file.FindReadNode("width")), Int32.Parse(file.FindReadNode("height")));

            loadSoundSettings();

            _position          = new Position((int)limit.X / 2, (int)limit.Y / 2);
            _weapon            = new Handgun();
            _weapon.shootSound = _sounds[0];

            file.ReadClose();
        }
Example #7
0
        public void LoadPreferenceData()
        {
            //Load from Database.sdf
            XmlReaderWriter file = new XmlReaderWriter();

            file.OpenRead("Preference.xml");

            buttons[TEXTBOX_INDEX].Text = file.ReadNextTextNode();
            brightness            = Int32.Parse(file.ReadNextTextNode());
            contrast              = Int32.Parse(file.ReadNextTextNode());
            Music_Preview.Volume  = float.Parse(file.ReadNextTextNode());
            Sound_Preview.Volume  = float.Parse(file.ReadNextTextNode());
            Sound_Preview.Pitch   = float.Parse(file.ReadNextTextNode());
            Sound_Preview.Pan     = float.Parse(file.ReadNextTextNode());
            graphics.IsFullScreen = Boolean.Parse(file.ReadNextTextNode());

            file.ReadClose();
            graphics.ApplyChanges();
        }
Example #8
0
        public Player()
        {
            XmlReaderWriter file = new XmlReaderWriter();

            file.OpenRead("Preference.xml");

            limit = new Vector2(Int32.Parse(file.FindReadNode("width")), Int32.Parse(file.FindReadNode("height")));

            _position = new Position((int)limit.X / 2, (int)limit.Y / 2);

            file.ReadClose();

            /********************************************************************
             * **************************************************************** *
             *******************************************************************/

            _weapon = new Handgun();

            /********************************************************************
             * **************************************************************** *
             *******************************************************************/
        }