Exemplo n.º 1
0
        public Link(Game1 game)
        {
            this.game = game;
            // TODO Add this into sprite factory
            Texture2D          linkTexture = game.Content.Load <Texture2D>("Link");
            Texture2D          linkDamageSequenceTexture = game.Content.Load <Texture2D>("LinkDamageSequence");
            Texture2D          linkDeathTexture          = game.Content.Load <Texture2D>("LinkDeath");
            Texture2D          rectangleTexture          = new Texture2D(game.GraphicsDevice, 1, 1);
            GenericTextureMask linkDamageMaskHandler     = new GenericTextureMask(linkTexture, linkDamageSequenceTexture, LinkConstants.DamageMaskRows, LinkConstants.DamageMaskCols, 0);
            SingleMaskHandler  linkDeathMaskHandler      = new SingleMaskHandler(linkTexture, linkDeathTexture);

            Vector2 centerPosition = new Vector2(0, 0);

            linkSprite       = new LinkSprite(game.SpriteBatch, linkTexture, rectangleTexture, LinkConstants.LinkTextureRows, LinkConstants.LinkTextureCols, linkDamageMaskHandler, linkDeathMaskHandler, centerPosition);
            linkStateMachine = new LinkStateMachine(game, linkSprite, centerPosition);
            linkInventory    = linkStateMachine.Inventory;
            linkInventory.ChangeItem(InventoryManager.ItemType.None);

            //Link's body does no damage itself
            this.collidable      = new PlayerCollidable(this, 0, game);
            isGrabbed            = false;
            remainingDamageDelay = DamageConstants.DamageDisableDelay;
        }
Exemplo n.º 2
0
 public LinkInventory(Game1 game, LinkStateMachine linkState)
 {
     this.linkState = linkState;
     batch          = game.SpriteBatch;
     this.game      = game;
 }