Ejemplo n.º 1
0
        public override void Draw(Graphics g)
        {
            //Show only if its collidable
            if (!HasPegInfo)
            {
                if (Level.ShowCollision && !Collision)
                {
                    return;
                }
            }

            base.Draw(g);

            //Get location and angle
            PointF location = DrawLocation;
            float  angle    = mAngle;

            if (MovementInfo != null)
            {
                angle = MovementInfo.GetEstimatedMoveAngle(mAngle);
            }

            //Calculate the brick destination rectangle
            float height = GetHeight();

            if (Curved)
            {
                //Rotate the matrix
                Matrix mx = new Matrix();
                mx.RotateAt(-angle, location);
                g.Transform = mx;

                DrawCurvedBrick(g, location);

                g.Transform = new Matrix();
            }
            else
            {
                //Rotate the matrix
                Matrix mx = new Matrix();
                mx.RotateAt(-angle + 90.0f, new PointF(location.X, location.Y));
                g.Transform = mx;

                DrawStrightBrick(g, location);

                g.Transform = new Matrix();
            }
        }