示例#1
0
 public void Draw(SpriteBatch spriteBatch)
 {
     //Manually center sprite since we dont use TextureAtlas, but a raw texture.
     if (mDirectional)
     {
         //mAngle = (float)Math.Atan2(mVelocity.Y, mVelocity.X) + (float)(90*Math.PI/180);
         mAngle = (float)Math.Atan2(mVelocity.Y, mVelocity.X);
     }
     //Vector2 origin = new Vector2(mTexture.Width / 2, mTexture.Height / 2);
     //spriteBatch.Draw(mTexture, mPosition, null, Color.White, mAngle, origin, 1.0f, SpriteEffects.None, 1.0f);
     if (mAllied)
     {
         mAtlas.Draw(spriteBatch, mBulletType, mBulletColor, mPosition, mAngle, 1.0f, SpriteEffects.None, 1.0f, 0.5f);
     }
     else
     {
         mAtlas.Draw(spriteBatch, mBulletType, mBulletColor, mPosition, mAngle, 1.0f, SpriteEffects.None, 1.0f, 1.0f);
     }
 }
示例#2
0
        public void Draw(SpriteBatch sb)
        {
            Rectangle r = new Rectangle(0, 0, 5, 5);

            for (int i = 0; i < mPathPoints.Count - 2; i++)
            {
                Utility.DrawLine(sb, debugTexture, mPathPoints[i], mPathPoints[i + 1], Color.Gold);
                //Utility.DrawRectangle(sb, debugTexture, mPathPoints[i], r, Color.Yellow);
            }
            mEnemyAtlas.Draw(sb, mSpriteName, mCurrentSequence.GetKeyAt(mSequenceIndex), mPosition);
        }