Time for action – building the GameObject class – part 1
Add a new class called
GameObject
to the Gemstone Hunter project.Add the following
Imports
directive to the top of theGameObject
class file:Imports Tile_Engine
Add declarations to the
GameObject
class:#Region "Declarations" Protected _frameWidth As Integer Protected _frameHeight As Integer Protected _collisionRectangle As Rectangle Protected _collideWidth As Integer Protected _collideHeight As Integer Protected _animations As Dictionary(Of String, AnimationStrip) = New Dictionary(Of String, AnimationStrip)() Protected _currentAnimation As String #End Region
Add properties to the
GameObject
class:#Region "Properties" Public Property Enabled As Boolean Public Property Flipped As Boolean = False Public Property OnGround As Boolean = False Public Property CodeBasedBlocks As Boolean = True Public Property WorldLocation As Vector2 Public Property Velocity As Vector2 Public Property DrawDepth As Single = 0.85 Public ReadOnly Property...