using Microsoft.Xna.Framework.Graphics; /** * A peanut in Pick up the Peanuts. * * @author Jim Glenn * @version 0.1 1/20/2009 */ namespace Peanuts { public class Peanut : Sprite { /** * The size of a peanut. */ public const double DefaultSize = 0.01; /** * Creates a new peanut at the given position. * The peanut will be red. * * @param initX an x-coordinate within the world this peanut will be in * @param initY a y-coordinate within the world this peanut will be in */ public Peanut(double initX, double initY) : base(initX, initY, DefaultSize, Color.Orange) { } /** * Returns the value of this peanut when eaten by the player. * * @return the value of this peanut */ public int GetValue() { if (GetStateTime() < 2.0) { return 50; } else if (GetStateTime() < 4.0) { return 20; } else { return 10; } } } }