Exemplo n.º 1
0
        xTile.Dimensions.Rectangle _viewport; //camera

        #endregion Fields

        #region Constructors

        public Level(int levelNumber, ProgressData progressData)
        {
            //set camera size based on screen size
            _viewport = new xTile.Dimensions.Rectangle(
                new xTile.Dimensions.Size(
                    Game1.SCREEN_WIDTH, Game1.SCREEN_HEIGHT));

            //load the map for the specified level
            _tileMap = Content.Load<Map>("Maps\\Level" + levelNumber.ToString());
            //load tile sheet
            _tileMap.LoadTileSheets(MapDisplayDevice);

            scanMapLayers();
            //_instructionScreen = Content.Load
            _progressData = progressData;
            _progressData.CurrentLevel = levelNumber;

            Weapon.Initialize();
            _gino.addHealth(progressData.addHealth);
            _gino.SetWeapon(new Weapon(progressData.shopWeapon, _gino));
            _gino.addAmmo(progressData.addAmmo);

            //_gino.SetWeapon(new Weapon("Revolver", _gino));

            _endTimer = TimeSpan.FromSeconds(TIME_AFTER_LOSS);
        }
Exemplo n.º 2
0
 public static ProgressData LoadProgress()
 {
     ProgressData data = new ProgressData();
     FileStream fs = new FileStream(PROGRESSDATA_FILE, FileMode.Open, FileAccess.Read);
     XmlSerializer xs = new XmlSerializer(data.GetType());
     data = (ProgressData)xs.Deserialize(fs);
     fs.Close();
     return data;
 }
Exemplo n.º 3
0
 public Shop(ProgressData pd)
 {
     SoundPlayer.StopSound();
     SoundPlayer.StartSound("younger");
     for(int i = 0; i<5; i++)
         indices[i] = 0;
     for (int j = 0; j < 4; j++)
         countBought[j] = 0;
     locked = 0;
     lmainPic = 0;
     progressData = pd;
     progressData.shopWeapon = "Revolver";
     progressData.addAmmo = 0;
 }
Exemplo n.º 4
0
 public Overworld(ProgressData progressData)
 {
     //SoundPlayer.StartSound("shuffledrum");
     _progressData = progressData;
 }
Exemplo n.º 5
0
 public static void SaveProgress(ProgressData data)
 {
     FileStream fs = new FileStream(PROGRESSDATA_FILE, FileMode.Create);
     XmlSerializer xs = new XmlSerializer(data.GetType());
     xs.Serialize(fs, data);
     fs.Close();
 }