Exemplo n.º 1
0
        /// <summary>
        /// Default constructor.  Creates a GameObject with default values.
        /// </summary>
        /// <param name="spriteTexture">Texture2D image for object</param>
        /// <param name="x">Starting X coordinate of object</param>
        /// <param name="y">Starting Y coordinate of object</param>
        /// <param name="width">Width of object</param>
        /// <param name="height">Height of object</param>
        public GraphicElement(string elementName, Texture2D spriteTexture, int x, int y, int width, int height) : base(spriteTexture, x, y, width, height)
        {
            this.Name = elementName;

            if (elementName.Equals("LifeIcon"))
            {
                LivesLeft.Add(this);
            }
        }
Exemplo n.º 2
0
        /// <summary>
        /// This is a secondary constructor for the GameObject.
        /// </summary>
        /// <param name="spriteTexture">Texture2D image for object</param>
        /// <param name="x">Starting X coordinate of object</param>
        /// <param name="y">Starting Y coordinate of object</param>
        /// <param name="width">Width of object</param>
        /// <param name="height">Height of object</param>
        /// <param name="addGravity">Does this object require immediate gravity implementation</param>
        public GraphicElement(string elementName, Texture2D spriteTexture, int SpritesInSheet, int x, int y, int width, int height,
                              bool addGravity) :
            base(spriteTexture, SpritesInSheet, x, y, width, height, addGravity)
        {
            this.Name = elementName;

            if (elementName.Equals("LifeIcon"))
            {
                LivesLeft.Add(this);
            }
        }