Time for action – basic Sprite properties
Add the following public properties to allow access to the
Sprite
class' members:Public Property Location As Vector2 Get return _location End Get Set(value As Vector2) _location = value End Set End Property Public Property Velocity as Vector2 Get return _velocity End Get Set(value as Vector2) _velocity = value End Set End Property Public Property TintColor as Color Get return _tintColor End Get Set(value as Color) _tintColor = value End Set End Property Public Property Rotation as Single Get return _rotation End Get Set(value as Single) _rotation = value Mod MathHelper.TwoPi End Set End Property
What just happened?
The Location
, Velocity
, and TintColor
properties are simple pass-throughs for their underlying private members, as no additional code or checks need to be done when these values are manipulated.
When Rotation...