Example #1
0
        private void PlacePlayer()
        {
            Player player = ActorGenerator.CreatePlayer();

            player.X = _map.Rooms[0].Center.X;
            player.Y = _map.Rooms[0].Center.Y;

            _map.AddPlayer(player);
        }
Example #2
0
 private void PlaceMonsters()
 {
     foreach (var room in _map.Rooms)
     {
         if (Dice.Roll("1D10") < 7)
         {
             var numberOfMonsters = Dice.Roll("1D4");
             for (int i = 0; i < numberOfMonsters; i++)
             {
                 if (_map.DoesRoomHaveWalkableSpace(room))
                 {
                     Point randomRoomLocation = _map.GetRandomLocationInRoom(room);
                     if (randomRoomLocation != null)
                     {
                         _map.AddMonster(ActorGenerator.CreateMonster(_level, _map.GetRandomLocationInRoom(room)));
                     }
                 }
             }
         }
     }
 }