public override void Draw(GameTime gameTime)
 {
     List <Vector2> .Enumerator currentEnum = reflectionPosition.GetEnumerator();
     List <Vector2> .Enumerator nextEnum    = reflectionPosition.GetEnumerator();
     nextEnum.MoveNext();
     while (nextEnum.MoveNext() && currentEnum.MoveNext())
     {
         Vector2     current      = currentEnum.Current;
         Vector2     next         = nextEnum.Current;
         Vector2     currentPoint = Level.ScreenPosition(current);
         Vector2     nextPoint    = Level.ScreenPosition(next);
         LineSegment lineSegment  = new LineSegment(currentPoint, nextPoint);
         lineSegment.Retrieve(10, DrawPoint);
     }
 }
Example #2
0
 public override void Draw(GameTime gameTime)
 {
     if (type == BlockType.MovableBlock)
     {
         for (int i = 0; i < tileFrame.X; i++)
         {
             for (int j = 0; j < tileFrame.Y; j++)
             {
                 Vector2 pos       = new Vector2(position.X + movableBlock.FrameSize.X * i, position.Y + movableBlock.FrameSize.Y * j);
                 Vector2 screenPos = Level.ScreenPosition(pos);
                 Game.SpriteBatch.Draw(movableBlock.Texture, screenPos,
                                       movableBlock.CurrentSourceRectangle, Color.White,
                                       0, movableBlock.Origin, 1.0f, SpriteEffects.None, 0.9f);
             }
         }
     }
     else
     {
         for (int i = 0; i < tileFrame.X; i++)
         {
             for (int j = 0; j < tileFrame.Y; j++)
             {
                 Vector2 pos       = new Vector2(position.X + texture.Width * i, position.Y + texture.Height * j);
                 Vector2 screenPos = Level.ScreenPosition(pos);
                 if (type == BlockType.Ground)
                 {
                     Game.SpriteBatch.Draw(texture,
                                           new Rectangle((int)screenPos.X, (int)screenPos.Y, texture.Width, (int)(Level.Height - position.Y)),
                                           null, Color.White, 0, Vector2.Zero, SpriteEffects.None, 0.2f);
                 }
                 else
                 {
                     Game.SpriteBatch.Draw(texture,
                                           new Rectangle((int)screenPos.X, (int)screenPos.Y, texture.Width, texture.Height),
                                           null, Color.White, 0, Vector2.Zero, SpriteEffects.None, 0.2f);
                 }
             }
         }
     }
 }