Ejemplo n.º 1
0
        public static void itemCreator(IItem displayItem, IDictionary <Type, int> itemDict, List <IItem> items, int x, int y)
        {
            switch (itemDict[displayItem.GetType()])
            {
            case 0:
                items.Add(new FireFlower(new Vector2(x, y)));
                break;

            case 1:
                GreenMushroom gm = new GreenMushroom(new Vector2(x, y));
                gm.ToggleHidden();
                gm.SetCurrentHeight(17);
                items.Add(gm);
                break;

            case 2:
                items.Add(new RedMushroom(new Vector2(x, y)));
                break;

            case 3:
                Star st = new Star(new Vector2(x, y));
                st.SetCurrentHeight(16);
                items.Add(st);
                break;

            case 4:
                items.Add(new VisibleCoin(new Vector2(x, y)));
                break;
            }
        }
Ejemplo n.º 2
0
        public void InitItems()
        {
            displayItems.Add(new RedMushroom(new Vector2(16, 16)));
            GreenMushroom gm = new GreenMushroom(new Vector2(16, 48));

            gm.ToggleHidden();
            gm.SetCurrentHeight(17);
            displayItems.Add(gm);

            Star st = new Star(new Vector2(48, 16));

            st.SetCurrentHeight(16);
            displayItems.Add(st);
            displayItems.Add(new FireFlower(new Vector2(48, 48)));
            displayItems.Add(new VisibleCoin(new Vector2(16, 80)));
        }