public HUDHearts(LegendOfZelda game)
 {
     this.game          = game;
     numFullHearts      = 0;
     numHalfHearts      = 0;
     numEmptyHearts     = 0;
     sheetX             = 0;
     sheetY             = 0;
     finalX             = 476;
     initX              = 372;
     initY              = 80;
     currentX           = 372;
     currentY           = 80;
     currentInt         = 0;
     fullX              = 0;
     fullY              = 34;
     halfX              = 8;
     halfY              = 0;
     emptyX             = 16;
     emptyY             = 0;
     rowDiff            = 13;
     columnDiff         = 12;
     suddenDeathOffset  = 20;
     suddenDeathMessage = FontSpriteFactory.GetSuddenDeathMessage();
 }
        public void Draw()
        {
            if (count < 100)
            {
                char1 = FontSpriteFactory.GetX();
                char2 = GetInt(count.ToString().Substring(0, 1));
                if (count.ToString().Length > 1)
                {
                    char3 = GetInt(count.ToString().Substring(1, 1));
                }
            }
            else
            {
                char1 = GetInt(count.ToString().Substring(0, 1));
                char2 = GetInt(count.ToString().Substring(1, 1));
                char3 = GetInt(count.ToString().Substring(2, 1));
            }

            //Get the coordinates of the characters
            char1.X = xCoord;
            char2.X = xCoord + 17;
            char1.Y = char2.Y = offset + yCoord;

            //Draw the characters
            char1.Draw(game.spriteBatch);
            char2.Draw(game.spriteBatch);
            if (char3 != null && count > 9)
            {
                char3.X = xCoord + 30;
                char3.Y = offset + yCoord;
                char3.Draw(game.spriteBatch);
            }
        }
Beispiel #3
0
 public SelectGameState(LegendOfZelda game)
 {
     this.game         = game;
     this.selectScreen = FontSpriteFactory.GetModeScreen();
     selectScreen.X    = 40;
     selectScreen.Y    = 40;
     this.screen       = Textures.GetBlankTexture();
     selector          = new ModeSelector(this.game);
     game.keyboard     = GameSetup.CreateMenuKeysController(game);
 }
        private static ISprite GetInt(string str)
        {
            int     integer = Int32.Parse(str);
            ISprite temp;

            switch (integer)
            {
            case 0:
                temp = FontSpriteFactory.Get0();
                break;

            case 1:
                temp = FontSpriteFactory.Get1();
                break;

            case 2:
                temp = FontSpriteFactory.Get2();
                break;

            case 3:
                temp = FontSpriteFactory.Get3();
                break;

            case 4:
                temp = FontSpriteFactory.Get4();
                break;

            case 5:
                temp = FontSpriteFactory.Get5();
                break;

            case 6:
                temp = FontSpriteFactory.Get6();
                break;

            case 7:
                temp = FontSpriteFactory.Get7();
                break;

            case 8:
                temp = FontSpriteFactory.Get8();
                break;

            case 9:
                temp = FontSpriteFactory.Get9();
                break;

            default:
                temp = FontSpriteFactory.GetX();
                break;
            }
            return(temp);
        }
Beispiel #5
0
        public ItemShopState(LegendOfZelda game)
        {
            this.game              = game;
            this.itemShopScreen    = FontSpriteFactory.GetItemShopScreen();
            this.zeroBalanceSprite = MiscSpriteFactory.Instance.CreateZeroBalanceSprite();

            zeroBalanceSprite.X = 0;
            zeroBalanceSprite.Y = 370;
            this.screen         = Textures.GetBlankTexture();
            selector            = new ItemShopSelector(this.game);

            displayError = false;
        }
 public InventIcons(LegendOfZelda game)
 {
     itemDiff         = 40;
     smallDiff        = 5;
     firstRowY        = 75;
     secondRowY       = 105;
     bowDiff          = 15;
     mapCompassX      = 100;
     mapY             = 220;
     compassY         = 300;
     currentSpriteX   = 145;
     initX            = 275;
     this.game        = game;
     this.inventory   = game.Link.Inventory;
     boomerang        = ItemSpriteFactory.GetBoomerang();
     boomerang.X      = initX;
     boomerang.Y      = firstRowY;
     bomb             = ItemSpriteFactory.GetBomb();
     bomb.X           = boomerang.X + itemDiff;
     bomb.Y           = firstRowY - smallDiff;
     arrow            = ItemSpriteFactory.GetArrow();
     arrow.X          = bomb.X + itemDiff;
     arrow.Y          = bomb.Y;
     bow              = ItemSpriteFactory.GetBow();
     bow.X            = arrow.X + bowDiff;
     bow.Y            = arrow.Y;
     blueCandle       = ItemSpriteFactory.GetBlueCandle();
     blueCandle.Scale = 2;
     blueCandle.X     = arrow.X + itemDiff + smallDiff;
     blueCandle.Y     = arrow.Y;
     bluePotion       = ItemSpriteFactory.GetBluePotion();
     bluePotion.X     = bow.X;
     bluePotion.Y     = secondRowY;
     redPotion        = ItemSpriteFactory.GetRedPotion();
     redPotion.X      = bluePotion.X;
     redPotion.Y      = bluePotion.Y;
     map              = ItemSpriteFactory.GetMap();
     map.X            = mapCompassX;
     map.Y            = mapY;
     currentSprite    = FontSpriteFactory.GetWhiteBox();
     compass          = ItemSpriteFactory.GetCompass();
     compass.X        = mapCompassX;
     compass.Y        = compassY;
     selector         = ItemSpriteFactory.GetItemSelector();
     currentDelay     = 0;
     totalDelay       = smallDiff;
 }
 public void Draw()
 {
     char1   = FontSpriteFactory.GetP();
     char2   = FontSpriteFactory.GetA();
     char3   = FontSpriteFactory.GetU();
     char4   = FontSpriteFactory.GetS();
     char5   = FontSpriteFactory.GetE();
     char6   = FontSpriteFactory.GetD();
     char1.X = xCoord;
     char2.X = xCoord + 16;
     char3.X = xCoord + 32;
     char4.X = xCoord + 48;
     char5.X = xCoord + 64;
     char6.X = xCoord + 80;
     char1.Y = char2.Y = char3.Y = char4.Y = char5.Y = char6.Y = yCoord;
     char1.Draw(game.spriteBatch);
     char2.Draw(game.spriteBatch);
     char3.Draw(game.spriteBatch);
     char4.Draw(game.spriteBatch);
     char5.Draw(game.spriteBatch);
     char6.Draw(game.spriteBatch);
 }
 public HUDCurrentItem(LegendOfZelda game)
 {
     this.game     = game;
     currentSprite = FontSpriteFactory.GetWhiteBox();
 }