Time for action – building a computer terminal
Add a new class called
ComputerTerminal
to the Robot Rampage project.Add declarations to the
ComputerTerminal
class:#Region "Declarations" Private _activeSprite As Sprite Private _inactiveSprite As Sprite Public MapLocation As Vector2 Public Active As Boolean = True Public LastSpawnCounter As Single = 0 Public MinSpawnTime As Single = 6 #End Region
Add a constructor to the
ComputerTerminal
class:#Region "Constructor" Public Sub New( activeSprite As Sprite, inactiveSprite As Sprite, mapLocation As Vector2) _activeSprite = activeSprite _inactiveSprite = inactiveSprite Me.MapLocation = mapLocation End Sub #End Region
Add public methods to the
ComputerTerminal
class:#region "Public Methods" Public Function IsCircleColliding( otherCenter As Vector2, radius As Single) As Boolean If Not Active Then Return False End If Return _activeSprite.IsCircleColliding(otherCenter, radius) End Function Public...