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; }
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()); }
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; }
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; }
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; }
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; }
public Bow() { sprite = ItemSpriteFactory.GetBow(); Hitbox = sprite.Box; }
public TriforceShard(LegendOfZelda game) { sprite = ItemSpriteFactory.GetTriforceShard(); Hitbox = sprite.Box; this.game = game; }
public HeartContainer() { sprite = ItemSpriteFactory.GetHeartContainer(); Hitbox = sprite.Box; }
public Map() { sprite = ItemSpriteFactory.GetMap(); Hitbox = sprite.Box; }
public RedPotion() { sprite = ItemSpriteFactory.GetRedPotion(); Hitbox = sprite.Box; }
public BluePotion() { sprite = ItemSpriteFactory.GetBluePotion(); Hitbox = sprite.Box; }
public Bomb() { sprite = ItemSpriteFactory.GetBomb(); sprite.Scale = 2; Hitbox = sprite.Box; }
public BlueCandle() { sprite = ItemSpriteFactory.GetBlueCandle(); sprite.Scale = 2; Hitbox = sprite.Box; }
public Compass() { sprite = ItemSpriteFactory.GetCompass(); Hitbox = sprite.Box; }
public BlueRupee() { sprite = ItemSpriteFactory.GetBlueRupee(); Hitbox = sprite.Box; }
public Key() { sprite = ItemSpriteFactory.GetKey(); Hitbox = sprite.Box; }