Beispiel #1
0
 public HeartContainer(ZeldaGame game, ItemSpriteFactory itemFactory, Vector2 location)
 {
     this.game         = game;
     this.spriteScalar = game.util.spriteScalar;
     this.position     = location;
     this.itemFactory  = itemFactory;
     this.itemSprite   = itemFactory.HeartContainer();
     game.collisionManager.collisionEntities.Add(this, hitbox);
 }
 public FireFlowerSprite(int positionX, int positionY, FireFlowerFrame fireFlowerFrame)
 {
     Location     = new Vector2(positionX, positionY);
     WidthHeight  = new Vector2(ItemSpriteFactory.ITEM_WIDTH, ItemSpriteFactory.ITEM_HEIGHT);
     Boundary     = new Rectangle((int)Location.X, (int)Location.Y, (int)WidthHeight.X, (int)WidthHeight.Y);
     frame        = fireFlowerFrame;
     currentFrame = ItemSpriteFactory.FireFlower(frame);
     EntityType   = TileMapInterpreter.Entities.FLOWER;
 }
Beispiel #3
0
 public Fairy(ZeldaGame game, ItemSpriteFactory itemFactory, Vector2 location)
 {
     this.game         = game;
     this.spriteScalar = game.util.spriteScalar;
     this.position     = location;
     this.itemFactory  = itemFactory;
     this.itemSprite   = itemFactory.Fairy();
     game.collisionManager.collisionEntities.Add(this, CollisionRectangle());
 }
Beispiel #4
0
 public CoinSprite(int positionX, int positionY, CoinType coinType, CoinFrame coinFrame)
 {
     Location     = new Vector2(positionX, positionY);
     WidthHeight  = new Vector2(ItemSpriteFactory.ITEM_WIDTH, ItemSpriteFactory.ITEM_HEIGHT);
     Boundary     = new Rectangle((int)Location.X, (int)Location.Y, (int)WidthHeight.X, (int)WidthHeight.Y);
     type         = coinType;
     frame        = coinFrame;
     currentFrame = ItemSpriteFactory.Coin(type, frame);
     EntityType   = TileMapInterpreter.Entities.COIN;
 }
Beispiel #5
0
 public StarmanSprite(int positionX, int positionY, StarmanFrame starmanFrame)
 {
     Location     = new Vector2(positionX, positionY);
     WidthHeight  = new Vector2(ItemSpriteFactory.ITEM_WIDTH, ItemSpriteFactory.ITEM_HEIGHT);
     Boundary     = new Rectangle((int)Location.X, (int)Location.Y, (int)WidthHeight.X, (int)WidthHeight.Y);
     frame        = starmanFrame;
     currentFrame = ItemSpriteFactory.Starman(frame);
     EntityType   = TileMapInterpreter.Entities.STAR;
     IsBounded    = false;
 }
Beispiel #6
0
        public MushroomSprite(int positionX, int positionY, MushroomType mushroomType)
        {
            Location    = new Vector2(positionX, positionY);
            WidthHeight = new Vector2(ItemSpriteFactory.ITEM_WIDTH, ItemSpriteFactory.ITEM_HEIGHT);
            Boundary    = new Rectangle((int)Location.X, (int)Location.Y, (int)WidthHeight.X, (int)WidthHeight.Y);

            type         = mushroomType;
            currentFrame = ItemSpriteFactory.Mushroom(type);
            if (mushroomType.Equals(MushroomType.Super))
            {
                EntityType = TileMapInterpreter.Entities.SUPER_MUSHROOM;
            }
            else
            {
                EntityType = TileMapInterpreter.Entities.UP_MUSHROOM;
            }

            IsBounded = false;
        }
Beispiel #7
0
        public void Update(GameTime gameTime)
        {
            elapsedFrames += (float)gameTime.ElapsedGameTime.TotalSeconds * 60;

            if (WasHit)
            {
                if (elapsedFrames > 5)
                {
                    WasHit        = false;
                    elapsedFrames = 0;
                }
            }


            if (elapsedFrames > 5 && frame == CoinFrame.FirstFrame)
            {
                frame         = CoinFrame.Rotate1;
                currentFrame  = ItemSpriteFactory.Coin(type, frame);
                elapsedFrames = 0;
            }
            else if (elapsedFrames > 5 && frame == CoinFrame.Rotate1)
            {
                frame         = CoinFrame.Rotate2;
                currentFrame  = ItemSpriteFactory.Coin(type, frame);
                elapsedFrames = 0;
            }
            else if (elapsedFrames > 5 && frame == CoinFrame.Rotate2)
            {
                frame         = CoinFrame.Rotate3;
                currentFrame  = ItemSpriteFactory.Coin(type, frame);
                elapsedFrames = 0;
            }
            else if (elapsedFrames > 5 && frame == CoinFrame.Rotate3)
            {
                frame         = CoinFrame.FirstFrame;
                currentFrame  = ItemSpriteFactory.Coin(type, frame);
                elapsedFrames = 0;
            }
        }
        public void Update(GameTime gameTime)
        {
            elapsedFrames += (float)gameTime.ElapsedGameTime.TotalSeconds * 60;

            if (WasHit)
            {
                if (elapsedFrames > 5)
                {
                    WasHit        = false;
                    elapsedFrames = 0;
                }
            }
            if (elapsedFrames > 5 && frame == FireFlowerFrame.FirstFrame)
            {
                frame         = FireFlowerFrame.Flash1;
                currentFrame  = ItemSpriteFactory.FireFlower(frame);
                elapsedFrames = 0;
            }
            else if (elapsedFrames > 5 && frame == FireFlowerFrame.Flash1)
            {
                frame         = FireFlowerFrame.Flash2;
                currentFrame  = ItemSpriteFactory.FireFlower(frame);
                elapsedFrames = 0;
            }
            else if (elapsedFrames > 5 && frame == FireFlowerFrame.Flash2)
            {
                frame         = FireFlowerFrame.Flash3;
                currentFrame  = ItemSpriteFactory.FireFlower(frame);
                elapsedFrames = 0;
            }
            else if (elapsedFrames > 5 && frame == FireFlowerFrame.Flash3)
            {
                frame         = FireFlowerFrame.FirstFrame;
                currentFrame  = ItemSpriteFactory.FireFlower(frame);
                elapsedFrames = 0;
            }
        }
 public WhiteSword()
 {
     sprite = ItemSpriteFactory.GetWhiteSword();
     Hitbox = sprite.Box;
 }
Beispiel #10
0
 public Bow()
 {
     sprite = ItemSpriteFactory.GetBow();
     Hitbox = sprite.Box;
 }
Beispiel #11
0
 public TriforceShard(LegendOfZelda game)
 {
     sprite    = ItemSpriteFactory.GetTriforceShard();
     Hitbox    = sprite.Box;
     this.game = game;
 }
Beispiel #12
0
 public HeartContainer()
 {
     sprite = ItemSpriteFactory.GetHeartContainer();
     Hitbox = sprite.Box;
 }
Beispiel #13
0
 public Map()
 {
     sprite = ItemSpriteFactory.GetMap();
     Hitbox = sprite.Box;
 }
 public RedPotion()
 {
     sprite = ItemSpriteFactory.GetRedPotion();
     Hitbox = sprite.Box;
 }
Beispiel #15
0
 public BluePotion()
 {
     sprite = ItemSpriteFactory.GetBluePotion();
     Hitbox = sprite.Box;
 }
Beispiel #16
0
 public Bomb()
 {
     sprite       = ItemSpriteFactory.GetBomb();
     sprite.Scale = 2;
     Hitbox       = sprite.Box;
 }
Beispiel #17
0
 public BlueCandle()
 {
     sprite       = ItemSpriteFactory.GetBlueCandle();
     sprite.Scale = 2;
     Hitbox       = sprite.Box;
 }
Beispiel #18
0
 public Compass()
 {
     sprite = ItemSpriteFactory.GetCompass();
     Hitbox = sprite.Box;
 }
 public BlueRupee()
 {
     sprite = ItemSpriteFactory.GetBlueRupee();
     Hitbox = sprite.Box;
 }
Beispiel #20
0
 public Key()
 {
     sprite = ItemSpriteFactory.GetKey();
     Hitbox = sprite.Box;
 }