Now, it's time to put some ice into our level.  Ice can either function as a platform or a wall.  We will
do ice like a platform now, but we can always do another ice that functions as a wall.  Of course, the most
important part of ice is that it must be slippery.  To simulate the slipperiness of ice, we will allow the
player's horizontal velocity along the ice to change when the left or right button is located (for perfectly
frictionless ice, i.e. no slowdown for long periods of time like real ice does).  So, as with tradition,
we'll set up a test ice platform and draw it first.
Declaration:
    Dim IceBrsh As Brush
    'How we'll draw the brush.
    Dim Ices As Integer
    'Holds all of the ice platforms in the level.
    Dim Ice As Rectangle
    'Holds the location of the ice.
Initialization:
        IceBrsh = New SolidBrush(Color.FromArgb(192, 32, 128, 255))
        'Translucent cold looking blue brush color.

        Ice = New Rectangle(1700, 350, 400, 160)
        'Creates an ice.
        Ices = New ArrayList
        Ices.Add(Ice)
        'Create the ices arraylist and add our ice rectangle to it.
Artwork:
        For Each Ice In Ices
            Ice.Offset(-ScreenLeft, -ScreenTop)
            GFX.FillRectangle(IceBrsh, Ice)
            GFX.DrawRectangle(Pens.DarkCyan, Ice)
            Ice.Offset(ScreenLeft, ScreenTop)
            'Draws the ice.
        Next
Now, for the actual movement based on the ice location - we get a variable that indicates the player's horizontal velocity while on the ice.
    Dim HorizontVeloc As Integer
    'How fast the player is moving left-right on surface such as ice.
    Dim OnIce As Boolean
    'True if the player is walking on ice.
First, we'll do the platform-like interface for the player:
                For Each Ice In Ices
                    'Looking at each platform in the platform array.
                    If PlayerVeloc > 0 AndAlso PlayerLoc.Bottom >= Ice.Top AndAlso PlayerLoc.Bottom - PlayerVeloc - GRAVITYTH <= Ice.Top Then
                        If PlayerLoc.Left < Ice.Right AndAlso PlayerLoc.Right > Ice.Left Then
                            'The player has landed on this platform.  He needs to be updated.
                            'See how many advantages there are to using a Rectangle.

                            IsJumping = False
                            'Hit the ground, we are not jumping.
                            OnIce = True
                            'Just landed on some ice.
                            LeftEnd = Platform.Left : RightEnd = Platform.Right
                            'Set the endpoints for the platform.
                            AnimCycler = 0
                            'Reset cycler.

                            If GoLeft Then
                                If GoFast Then
                                    HorizontVeloc = -MOVESPEED - (MOVESPEED >> 1)
                                Else
                                    HorizontVeloc = -MOVESPEED
                                End If
                            ElseIf GoRight Then
                                If GoFast Then
                                    HorizontVeloc = MOVESPEED + (MOVESPEED >> 1)
                                Else
                                    HorizontVeloc = MOVESPEED
                                End If
                            End If
                            'The above lines set the initial movement speed when the player initially lands on the ice.

                            PlayerLoc.Offset(0, Platform.Top - PlayerLoc.Bottom)
                            'Move the player onto this platform.
                        End If
                    End If
                Next
We declare a constant that defines the maximum sliding speed for the character. This number normally should not exceed terminal velocity, but we set it to much lower.
    Const ICEMAXSPEED As Integer = MOVESPEED * 2
    'The maximum speed that the player can move on the ice - should be slightly larger than fast movement speed.
Next, the player's velocity changes as he/she tries desperately to stop from sliding on the ice.
            If GoLeft Then
                If GoFast Then
                    If OnIce Then
                        HorizontVeloc -= (MOVESPEED + (MOVESPEED >> 1))
                        If -HorizontVeloc > ICEMAXSPEED Then
                            HorizontVeloc = -ICEMAXSPEED
                        End If
                    Else
                        PlayerLoc.Offset(-MOVESPEED - (MOVESPEED >> 1), 0)
                        'When Shift is pressed the player runs.
                        'Runs to the left.
                    End If
                Else
                    If OnIce Then
                        HorizontVeloc -= MOVESPEED
                        If -HorizontVeloc > ICEMAXSPEED Then
                            HorizontVeloc = -ICEMAXSPEED
                        End If
                    Else
                        PlayerLoc.Offset(-MOVESPEED, 0)
                        'Move player left.
                    End If

                End If
                LeftMovementChecks()
                CharDirec = 0   'Look left.
                'Now, update the animation cycler.
                AnimCycler = (AnimCycler + 1) Mod WALKINGFRAMECOUNT
            ElseIf GoRight Then
                If GoFast Then
                    If OnIce Then
                        HorizontVeloc += (MOVESPEED + (MOVESPEED >> 1))
                        If HorizontVeloc > ICEMAXSPEED Then
                            HorizontVeloc = ICEMAXSPEED
                        End If
                    Else
                        PlayerLoc.Offset(MOVESPEED + (MOVESPEED >> 1), 0)
                        'Runs to the right.
                    End If
                Else
                    If OnIce Then
                        HorizontVeloc += MOVESPEED
                        If HorizontVeloc > ICEMAXSPEED Then
                            HorizontVeloc = ICEMAXSPEED
                        End If
                    Else
                        PlayerLoc.Offset(MOVESPEED, 0)
                        'Move player right.
                    End If

                End If

                RightMovementChecks()
                CharDirec = 1   'Look right.
                'Now, update the animation cycler.
                AnimCycler = (AnimCycler + 1) Mod WALKINGFRAMECOUNT
            End If
We need to add this little clause on all surfaces that are not icy so that our player doesn't slide off regular surfaces.
                            OnIce = False : HorizontVeloc = 0
                            'We are no longer on ice.
The movement check subroutines are the stuff that was normally in that position, where the checks are for when the player walks into the side of a wall, moving block, or a jump board. And now, the actual sliding:
            If OnIce Then
                PlayerLoc.Offset(HorizontVeloc, 0)  'Slide to some direction.
                If HorizontVeloc < 0 Then
                    LeftMovementChecks()   'Check if we went too far left while sliding.
                ElseIf HorizontVeloc > 0 Then
                    RightMovementChecks()  'Check if we went too far right while sliding.
                End If
                If Not GoLeft OrElse Not GoRight Then
                    AnimCycler = (AnimCycler + 1) Mod WALKINGFRAMECOUNT
                End If
            End If
And now, we have some functional ice.
Now, let's go ahead and set up arrays of ice platforms.
        'Creates an ice.
        Ices = New ArrayList
        Ices.Add(New Rectangle(1500, 350, 400, 218))
        Ices.Add(Rectangle.FromLTRB(1350, 150, 1520, LANDHEIGHT))
        Ices.Add(Rectangle.FromLTRB(1620, 150, 1820, LANDHEIGHT))
        'Create the ices arraylist and add our ice rectangle to it.
The good news? It already works!
The next step is, of course, getting ice blocks to go into/from a file. So, let's set TESTversion to 1 and get to it. It's just like saving and loading platforms.
            'Ice written to file. 
            BW.Write(Ices.Count)
            'Next, each platform is written to file.
            For Each Ice In Ices
                BW.Write(Ice.Left)
                BW.Write(Ice.Top)
                BW.Write(Ice.Right)
                BW.Write(Ice.Bottom)
            Next
After you've converted all of your level files to this new format with ice in them, add the load procedure so that you can create them. Don't forget to delete the Ice arraylist initialization!
        Ices = New ArrayList(BR.ReadInt32())
        For LV = 1 To Ices.Capacity  'Capacity is the number that you've specified in the New arraylist's constructor.
            Ices.Add(Rectangle.FromLTRB(BR.ReadInt32(), BR.ReadInt32(), BR.ReadInt32(), BR.ReadInt32()))
            'Read four integers from the file and put it into a rectangle.
        Next

The last step is of course, making the support for ice in the editor. We can simply assign "I" to switch to ice - the remainder works just like the platform.
        ElseIf e.KeyCode = Keys.I Then
            If Not IsMouseDown Then
                MDObject = "I"c
            End If
            Case "I"c
                'For ice.
                Ices.Insert(0, Placed)
                'Add an ice platform.

Before you wrap it up, we have a bug to fix with moving walls - if you jump and bonk your head on a wall coming down you will appear on top of the moving wall. This is not good, but can be easily fixed by altering the code in the jumping collision section to the starred line below labeled with stars and BUG FIX.
                        Else
                            'The player has jumped up into the wall.
                            PlayerLoc.Offset(0, MobileWall.Loc.Bottom - PlayerLoc.Top)
                            'Move the player to under the wall.
                            PlayerVeloc = MobileWall.dY     '*************************BUG FIX**********************
                            'Make the player start falling down.