Beispiel #1
0
        public override void Render()
        {
            if (visibleOnCamera)
            {
                if (water == null || water.TopSurface == null)
                {
                    Draw.Rect(X + 1f, Y, 6f, height, fillColor);
                    Draw.Rect(X - 1f, Y, 2f, height, surfaceColor);
                    Draw.Rect(X + 7f, Y, 2f, height, surfaceColor);
                }
                else
                {
                    Water.Surface topSurface = water.TopSurface;
                    float         num        = height + water.TopSurface.Position.Y - water.Y;

                    for (int index = 0; index < 6; ++index)
                    {
                        Draw.Rect((float)(X + index + 1f), Y, 1f, num - topSurface.GetSurfaceHeight(new Vector2(X + 1f + index, water.Y)), fillColor);
                    }

                    Draw.Rect(X - 1f, Y, 2f, num - topSurface.GetSurfaceHeight(new Vector2(X, water.Y)), surfaceColor);
                    Draw.Rect(X + 7f, Y, 2f, num - topSurface.GetSurfaceHeight(new Vector2(X + 8f, water.Y)), surfaceColor);
                }
            }
        }