Time for action – animation and drawing properties
Add the following public properties to allow access to the
Sprite
class' members:Public Property Frame As Integer Get Return currentFrame End Get Set(value as Integer) currentFrame = CInt(MathHelper.Clamp(value, 0, frames.Count - 1)) End Set End Property Public Property FrameTime As Single Get return _frameTime End Get Set(value as Single) _frameTime = MathHelper.Max(0, value) End Set End Property Public ReadOnly Property Source As Rectangle Get return frames(currentFrame) End Get End Property Public ReadOnly Property Destination As Rectangle Get return new Rectangle( CInt(location.X), CInt(location.Y), frameWidth, frameHeight) End Get End Property Public ReadOnly Property Center As Vector2 Get return _location + new Vector2(CSng(frameWidth) / 2, CSng(frameHeight...