Beispiel #1
0
Datei: Game.cs Projekt: nadita/vj
        public void InitializeGameObjectValues()
        {
            //Initializing
            this.bomberman_is_dead = false;
            this.level_finished = false;
            this.end_time = false;
            this.actual_time = 180;
            this.level_finished = false;

            actualStage = new Stage();
            Level actualLevel = XmlMngr.GetInstance().levels[actual_stage];

            //Loading Blocks Data
            foreach (string[] block in actualLevel.blocks)
            {
                Cell newBlock = new Cell(Cell.BLOCK, Cell.NONE);
                int x = int.Parse(block[0]);
                int y = int.Parse(block[1]);
                actualStage.addItem(newBlock, x, y);
            }

            //Loading PowerUps Data
            foreach (string[] powerUp in actualLevel.powerUps)
            {
                Cell newPowerUp = new Cell(Cell.POWERUP, powerUp[0]);
                int x = int.Parse(powerUp[1]);
                int y = int.Parse(powerUp[2]);
                actualStage.addItem(newPowerUp, x, y);
            }

            //Loading Enemies Data
            foreach (string[] enemy in actualLevel.enemies)
            {
                int x = int.Parse(enemy[1]);
                int y = int.Parse(enemy[2]);

                Enemy newEnemy = new Enemy(enemy[0], x, y);
                actualStage.addEnemy(newEnemy);
            }
        }
Beispiel #2
0
 public void addItem(Cell c, int x, int y)
 {
     this.matrix[x][y] = c;
 }