Before we work on getting those Floaters to work, first we are going to set up the lava collections.

So, you may know the procedure by now.
First we declare the ArrayList of Lava in the declarations.

    Dim Lavas As ArrayList
    'Holds all of the lava pools for this level.
Then, we initialize the lava arraylist in the Load procedure. So, we replace the lava instantiation:
        Lava = Rectangle.FromLTRB(210, 520, 270, LANDHEIGHT)
        'Initialize the lava location.
With the instantiation for the lavas arraylist.
        Lavas = New ArrayList(20)
        'Create the arraylist.
        Lavas.Add(Rectangle.FromLTRB(210, 520, 270, LANDHEIGHT))
        'Initialize the lava location.
Now, we draw the lavas that are located in the arraylist. So the portion of code that draws the lava in the Artwork subroutine can be replaced with:
        For Each Lava In Lavas
            GFX.FillRectangle(LavaBrsh, Lava)
            GFX.DrawRectangle(Pens.Red, Lava)
            'The translucent lava will be drawn with a red box around the border.
        Next
Then, we allow the player to interact with the lava, by putting in the CharacterMovement subroutine another For Each Loop.
            For Each Lava In Lavas
                If Lava.IntersectsWith(PlayerLoc) Then
                    IsGoner = True
                    'The player steps into lava.  Lose a life.
                    PlayerVeloc = SBARINITIALVELOCITY
                End If
            Next
One gets used to that after a while of development. Now, let's add support for lava in our edit mode. In my level, there's not really a good spot for placing lava since I have coins everywhere, but I'll try to find one. Fortunately, for adding editor support, all we need to do is add another character (and of course getting it to save to / load from file). So, set TESTversion to 1 if you set it 0, and head onto the KeyDown event (remember, that's where we determine which key the user has pressed). Let's pick a character to denote lava. Hmmm, tough choice. How about "L"c? So, let's make L set us into lava placement mode.
        ElseIf e.KeyCode = Keys.L  Then
            If Not IsMouseDown Then
                MDObject = "L"c
            End If
Now, the object is finalized in the MouseUp routine (and the MouseUp routine only runs when TESTversion is set to 1).
            Case "L"c
                Placed = Rectangle.FromLTRB(Math.Min(InitialPt.X, Mu.X), Math.Min(InitialPt.Y, Mu.Y), Math.Max(InitialPt.X, Mu.X), Math.Max(InitialPt.Y, Mu.Y))
                Lavas.Insert(0, Placed)
                'Add a lava.
And now, you can add more than one patch of lava on the form. Now, support has to be added to save these patches of lava to the file. So, in the SaveLevel subroutine, we save the number of lavas and then save the LTRB of each lava as usual.
        'Next, lava is written to file
        BW.Write(Lavas.Count)
        'And then, each lava is written.
        For Each Lava In Lavas
            BW.Write(Lava.Left)
            BW.Write(Lava.Top)
            BW.Write(Lava.Right)
            BW.Write(Lava.Bottom)
        Next
And now, you can go in and edit the lava as you wish.
Now, when you are finished, remove the lava initialization code in the Load event.
        Lavas = New ArrayList(20)
        'Create the arraylist.
        Lavas.Add(Rectangle.FromLTRB(210, 520, 270, LANDHEIGHT))
        'Initialize the lava location.
Next, we need to add support for loading the lava back into the level, so let's go to the LoadLevel subroutine. Also, realize that we have to load the lavas in the same place that we saved them. So, if the lavas were saved after the coins, we need to load them after the coins.
        Lavas = New ArrayList(BR.ReadInt32())
        For LV = 1 To Lavas.Capacity
            Lavas.Add(Rectangle.FromLTRB(BR.ReadInt32(), BR.ReadInt32(), BR.ReadInt32(), BR.ReadInt32()))
            'Read the lavas into the file.
        Next
And there you have lavas loaded from file.
Now, an editor wouldn't be complete if you couldn't specify the file that you wanted to save to. Let's create a Save File Dialog so that we can save multiple files. First, we set the Save File Dialog properties. Then, we put all of the code that we have for saving the level inside of the If block. You can see the If statement below that indicates if the user has agreed on a file by clicking OK. Don't forget the Final End If.
        'Before we run the rest of this sub, let's get a filename.
        Dim SFD As SaveFileDialog = New SaveFileDialog
        SFD.Filter = "Data Files|*.dat"
        SFD.InitialDirectory = Application.StartupPath
        SFD.OverwritePrompt = True
        SFD.Title = "Select the location where this level will be saved."
        If SFD.ShowDialog() = DialogResult.OK Then
Now, you can save the file to a different filename.
Next, let's allow different files to be read. We will add a parameter to LoadLevel that specifies which file to read for this level. So, now our declaration for LoadLevel looks like this.
    Private Sub LoadLevel(ByVal Filename As String)
And now, from the form's Load procedure, we have to call it like this:
        LoadLevel(Application.StartupPath & "\level.dat")
        'Loads the information for this level.
When we start the game, we'll eventually have a level variable which will be used to generate a filename. Next, we'll actually go over those floaters (hopefully).