Time for action – the MapSquare class
Add a new class called
MapSquare
to the Tile Engine project.Modify the declaration of the
MapSquare
class by adding the<Serializable()>
attribute before the class declaration. The class declaration should read:<Serializable()> Public Class MapSquare
Add the declarations region to the MapSquare class:
#Region "Declarations" Public LayerTiles(3) As Integer Public CodeValue As String = " Public Passable As Boolean = True #End Region
Add a constructor to the
MapSquare
class:#Region "Constructor" Public Sub New( background As Integer, interactive As Integer, foreground As Integer, code As String, passable As Boolean) LayerTiles(0) = background LayerTiles(1) = interactive LayerTiles(2) = foreground CodeValue = code Me.Passable = passable End Sub #End Region
Add the
TogglePassable()
method to theMapSquare
class:#Region "Public Methods" Public Sub TogglePassable() Passable = Not Passable End...