Time for action – updating GameBoard to support animated pieces
In the declarations section of the
GameBoard
class, add three Dictionaries, shown as follows:Public FallingPieces As Dictionary(Of String, FallingPiece) = New Dictionary(Of String, FallingPiece) Public RotatingPieces As Dictionary(Of String, RotatingPiece) = New Dictionary(Of String, RotatingPiece) Public FadingPieces As Dictionary(Of String, FadingPiece) = New Dictionary(Of String, FadingPiece)
Add methods to the
GameBoard
class to create new falling piece entries in the Dictionaries:Public Sub AddFallingPiece(x As Integer, y As Integer, type As String, verticalOffset As Integer) FallingPieces.Add( x.ToString() + "_" + y.ToString(), New FallingPiece(type, verticalOffset)) End Sub Public Sub AddRotatingPiece(x As Integer, y As Integer, type As String, clockwise As Boolean) RotatingPieces.Add( x.ToString() + "_" + y.ToString...