Ejemplo n.º 1
0
 /// <summary>
 /// Construct the player
 /// </summary>
 /// <param name="index"></param>
 /// <param name="color"></param>
 /// <param name="width"></param>
 /// <param name="height"></param>
 public Projectile(Color color, Vector2 position, int width, int height, Vector2 direction)
 {
     _mColor = color;
     _mRectangle = new Rectangle(0, 0, width, height);
     _mPosition = position;
     _mDirection = direction;
     _mLight = new Light(this, width*8, height*8);
 }
Ejemplo n.º 2
0
        public Projectile(Projectile projectile, Vector2 position, Vector2 direction)
        {
            _mColor = projectile._mColor;
            _mRectangle = projectile._mRectangle;
            _mTexture = projectile._mTexture;
            _mPosition = position;
            _mDirection = direction;

            _mLight = new Light(projectile._mLight, this);
        }
Ejemplo n.º 3
0
        /// <summary>
        /// Construct the player
        /// </summary>
        /// <param name="index"></param>
        /// <param name="color"></param>
        /// <param name="width"></param>
        /// <param name="height"></param>
        public Player(int index, Color color, int width, int height)
        {
            _mIndex = index;
            _mColor = color;
            _mRectangle = new Rectangle(0, 0, width, height);
            _mPosition.X = Game1._sRandom.Next() % Game1._sGraphics.PreferredBackBufferWidth;
            _mPosition.Y = Game1._sRandom.Next() % Game1._sGraphics.PreferredBackBufferHeight;
            PositionPlayerInBounds();

            _mLight = new Light(this, width*2, height*2);

            _mProjectilePrefab = new Projectile(color, new Vector2(-100, -100), 10, 10, Vector2.Zero);
        }
Ejemplo n.º 4
0
 /// <summary>
 /// Copy the texture from an existing light
 /// </summary>
 /// <param name="light"></param>
 /// <param name="parent"></param>
 public Light(Light light, Entity parent)
 {
     _mParent = parent;
     _mRectangle = light._mRectangle;
     _mTexture = light._mTexture;
 }