//----------------------//------------------------//        


        public GameShop(GameShopType type, Texture2D shopTexture, Texture2D arrowsTexture, Vector2 position)
        {
            // Default init
            _shopTexture = shopTexture;
            _arrowsTexture = arrowsTexture;
            _shopType = type;
            _position = position - (Vector2.UnitY * shopTexture.Height);
            _arrowPosition = new Vector2(_position.X + (_shopTexture.Width - ArrowWidth) / 2,
                _position.Y - _arrowsTexture.Height - 5);

            // Arrows init
            _arrowState = 0;
            _arrowSprites = new Rectangle[3];
            _arrowSprites[ArrowDefault] = new Rectangle(0, 0, 15, 16);
            _arrowSprites[ArrowClick] = new Rectangle(15, 0, 15, 16);
            _arrowSprites[ArrowDeny] = new Rectangle(30, 0, 15, 16);

            // Prices init
            _prices = new Dictionary<GameShopType, int>()
            {
                { GameShopType.Ammo, 10 },
                { GameShopType.Hearts, 15 },
                { GameShopType.Lives, 15 }
            };

            // Mechanics init
            _isActive = false;
            _clickTimer = 0;

            // SE init
            _buySe = SoundManager.LoadSe("Buy");
        }
예제 #2
0
        //----------------------//------------------------//


        public GameShop(GameShopType type, Texture2D shopTexture, Texture2D arrowsTexture, Vector2 position)
        {
            // Default init
            _shopTexture   = shopTexture;
            _arrowsTexture = arrowsTexture;
            _shopType      = type;
            _position      = position - (Vector2.UnitY * shopTexture.Height);
            _arrowPosition = new Vector2(_position.X + (_shopTexture.Width - ArrowWidth) / 2,
                                         _position.Y - _arrowsTexture.Height - 5);

            // Arrows init
            _arrowState   = 0;
            _arrowSprites = new Rectangle[3];
            _arrowSprites[ArrowDefault] = new Rectangle(0, 0, 15, 16);
            _arrowSprites[ArrowClick]   = new Rectangle(15, 0, 15, 16);
            _arrowSprites[ArrowDeny]    = new Rectangle(30, 0, 15, 16);

            // Prices init
            _prices = new Dictionary <GameShopType, int>()
            {
                { GameShopType.Ammo, 10 },
                { GameShopType.Hearts, 15 },
                { GameShopType.Lives, 15 }
            };

            // Mechanics init
            _isActive   = false;
            _clickTimer = 0;

            // SE init
            _buySe = SoundManager.LoadSe("Buy");
        }