Esempio n. 1
0
        private TileType type; // huidige type van tile

        #endregion Fields

        #region Constructors

        public Tile(Location init, TileType type, Boolean solid, Image texture, Level level)
        {
            //variabelen initalizeren
            this.level = level;
            this.solid = solid;
            this.texture = texture;
            this.pos = init;
            this.type = type;
            this.tilesize = 32;
        }
Esempio n. 2
0
        public Game(Loop loop)
        {
            this.loop = loop;

            //variablene intializeren
            keyboard = new Keyboard();

            // Level 1 initializeren
            XDocument level1 = XDocument.Parse(Properties.Resources.Level1);
            map = new Level(level1, this);
        }
Esempio n. 3
0
 //properties geven
 public FloorTile(Location init, Level level)
     : base(init, TileType.floor, false, Properties.Resources.floor_tile_texture, level)
 {
 }
Esempio n. 4
0
 //properties geven
 public WallTile(Location init, Level level)
     : base(init, TileType.wall, true, Properties.Resources.Wall, level)
 {
 }
Esempio n. 5
0
 // Methode om aan te roepen als je op de finish komt
 public void nextLevel()
 {
     timesWon++;
     paused = true;
     // Als aantal keren gewonnen gelijk of groter is dan het aantal levels heb je het spel uitgespeeld
     if(timesWon >= totalLevels)
     {
         var result = MessageBox.Show("Opnieuw spelen?", "You have beaten the game!",
                                                              MessageBoxButtons.YesNo);
         if (result == DialogResult.Yes)
         {
             paused = false;
             this.playAgain();
         }
         else if (result == DialogResult.No)
         {
             this.backToMain();
         }
     }
     // Zo niet, dan krijg je het volgende level
     else
     {
         var result = MessageBox.Show("Next level?", "You won!",
                                          MessageBoxButtons.YesNo);
         if (result == DialogResult.Yes)
         {
             paused = false;
             XDocument level = XDocument.Parse(levels[timesWon]);
             map = new Level(level, this);
         }
         else if (result == DialogResult.No)
         {
             this.backToMain();
         }
     }
 }
Esempio n. 6
0
 public void playAgain()
 {
     timesWon = 0;
     XDocument level = XDocument.Parse(levels[timesWon]);
     map = new Level(level, this);
 }
Esempio n. 7
0
 public ShrekTile(Location init, Image floor, Level level)
     : base(init, TileType.shrek, false, Properties.Resources.dank_shrek, level)
 {
     this.floor = floor;
 }
Esempio n. 8
0
 //properties geven
 public StartTile(Location init, Image floor, Level level)
     : base(init, TileType.floor, false, Properties.Resources.floor_tile_texture, level)
 {
     this.floor = floor;
 }