Exemplo n.º 1
0
        public void addSeed(SeedItem seed)
        {
            if (seed.GetCount() > 0 && plantedSeed == null)
            {
                switch (seed.GetName())
                {
                case "corn":
                    plantedSeed = new Corn(content, Position, this, game);
                    seed.Plant();
                    break;

                case "lettuce":
                    plantedSeed = new Lettuce(content, Position, this, game);
                    seed.Plant();
                    break;

                case "wheat":
                    plantedSeed = new Wheat(content, Position, this, game);
                    seed.Plant();
                    break;

                default:
                    break;
                }
            }
        }
Exemplo n.º 2
0
 public override void Draw(GameTime gameTime, SpriteBatch spriteBatch)
 {
     if (this.isSeed)
     {
         spriteBatch.Draw(slotTexture, Position + new Vector2(-10, -11), null, Color.White, 0f, Vector2.Zero, scale, SpriteEffects.None, 0f);
         spriteBatch.Draw(itemCount, Position + new Vector2(19, 80), null, Color.White, 0f, Vector2.Zero, scale, SpriteEffects.None, 0f);
         spriteBatch.Draw(Texture, Position, null, Color.White, 0f, Vector2.Zero, scale, SpriteEffects.None, 0f);
         spriteBatch.DrawString(font, "x " + seeditem.GetCount(), Position + new Vector2(33, 90), Color.Black);
         selectButton.Draw(gameTime, spriteBatch);
     }
     else
     {
         spriteBatch.Draw(slotTexture, Position + new Vector2(-10, -11), null, Color.White, 0f, Vector2.Zero, scale * 0.75f, SpriteEffects.None, 0f);
         spriteBatch.Draw(itemCount, Position + new Vector2(4, 50), null, Color.White, 0f, Vector2.Zero, scale, SpriteEffects.None, 0f);
         spriteBatch.DrawString(font, "x " + item.GetCount(), Position + new Vector2(18, 60), Color.Black);
         spriteBatch.Draw(Texture, Position + new Vector2(15, 5), null, Color.White, 0f, Vector2.Zero, scale, SpriteEffects.None, 0f);
         sellButton.Draw(gameTime, spriteBatch);
     }
 }