Sprite

Abstract base class for drawable game objects with a texture and transform.

Constructor

Abstract base class for drawable game objects with a texture and transform.

Properties


NameDescriptionType
textureThe sprite's texture.Texture
transformThe sprite's transform.Transform
velocityThe sprite's velocity.Vec2
visibleWhether the sprite is visible.bool

Methods


Draw

draw() None

Draw the sprite to the screen with its current transform.

Move

move() None

Apply frame-independent velocity to position.

Update

update() None

Update the sprite state (must be overridden).