Exemplo n.º 1
0
        internal void LoadContent(PlayableSector sectorToLoad)
        {
            int numberOfEnemies        = sectorToLoad.enemyPositions.Count();
            int numberOfCollectibles   = sectorToLoad.collectiblePositions.Count();
            int numberOfCollisionBoxes = sectorToLoad.collisionBoxes.Count();

            collisionBoxes       = sectorToLoad.collisionBoxes;
            enemyPositions       = new List <EnemyData>();
            collectiblePositions = new List <Vector2>();
            artPieces            = sectorToLoad.artPieces;

            for (int i = 0; i < numberOfEnemies; i++)
            {
                EnemyData tempEnemy = new EnemyData();

                tempEnemy.position     = new Vector2(sectorToLoad.enemyPositions[i].position.X, sectorToLoad.enemyPositions[i].position.Y);
                tempEnemy.enemyTexture = sectorToLoad.enemyPositions[i].enemyTexture;
                tempEnemy.enemyType    = sectorToLoad.enemyPositions[i].enemyType;

                enemyPositions.Add(tempEnemy);
            }

            for (int i = 0; i < numberOfCollectibles; i++)
            {
                Vector2 tempCollectible = new Vector2(sectorToLoad.collectiblePositions[i].X,
                                                      sectorToLoad.collectiblePositions[i].Y);

                collectiblePositions.Add(tempCollectible);
            }

            SectorRec = new Rectangle(sectorToLoad.SectorRec.X, sectorToLoad.SectorRec.Y,
                                      sectorToLoad.SectorRec.Width, sectorToLoad.SectorRec.Height);
        }
Exemplo n.º 2
0
        public void LoadContent(PlayableSurface surfaceToLoad)
        {
            int numberOfSectors;


            numberOfSectors = surfaceToLoad.playableSectors.Count();


            playableSectors = new PlayableSector[numberOfSectors];


            artFiles     = surfaceToLoad.artFiles;
            enemyFiles   = surfaceToLoad.enemyFiles;
            hatPositions = surfaceToLoad.hatPositions;


            for (int i = 0; i < numberOfSectors; i++)
            {
                playableSectors[i] = new PlayableSector();
                playableSectors[i].LoadContent(surfaceToLoad.playableSectors[i]);
            }
        }