Example #1
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);
        }
Example #2
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);
        }