Example #1
0
        partial void StartGameButton_TouchUpInside(UIButton sender)
        {
            var TabView = new UITabBarController();

            MapManager mapman = MapManager.Instance;

            mapman.GenMap();
            //mapman.WriteMap();


            dngNav = new UINavigationController(mapman.GetFirstRoom());


            //var dungeonRoom = mapman.GetFirstRoom();
            var mapView       = new VC_MapView();
            var inventoryView = new VC_Inventory();

            List <UIViewController> tabs = new List <UIViewController>();

            tabs.Add(dngNav);
            tabs.Add(mapView);
            tabs.Add(inventoryView);

            UIImage GameViewIcon      = UIImage.FromBundle("Tab Icon Images/ViewTabIcon.png");
            UIImage MapViewIcon       = UIImage.FromBundle("Tab Icon Images/MapTabIcon.png");
            UIImage InventoryViewIcon = UIImage.FromBundle("Tab Icon Images/itemsTabIcon.png");

            tabs[0].TabBarItem = new UITabBarItem("Game", GameViewIcon, GameViewIcon);
            tabs[1].TabBarItem = new UITabBarItem("Map", MapViewIcon, MapViewIcon);
            tabs[2].TabBarItem = new UITabBarItem("Inventory", InventoryViewIcon, InventoryViewIcon);
            TabView.SetViewControllers(tabs.ToArray(), true);

            Item_RustySword rustySword = new Item_RustySword();

            GameManager.Instance.playerCharacter.equipment.Add(rustySword);

            Item_HealthPotion HPPotion = new Item_HealthPotion();

            GameManager.Instance.playerCharacter.bag.Add(HPPotion);
            GameManager.Instance.playerCharacter.UpdateStats();

            PresentViewController(TabView, true, null);
        }
Example #2
0
        public ItemBase GenerateItem(int tier) //spawn a random item in a tier bracket
        {
            int index = 1;

            switch (tier)
            {
            case 1:
                index = randomBetween(0, Tier1.Count - 1);
                return(Tier1[index]);

            case 2:
                index = randomBetween(0, Tier2.Count - 1);
                return(Tier2[index]);

            case 3:
                index = randomBetween(0, Tier3.Count - 1);
                return(Tier3[index]);
            }

            var generatedItem = new Item_RustySword();

            return(generatedItem);
        }