A small entity type used for a sparkle/shine visual near coins. It sets position, sprite type, layer, speeds the animation to 1.5x, starts the "shine" animation and removes itself from the scene when the animation completes.
namespace Sandbox.Transposer;
/// <summary>
/// Sparkle animation played near coins. Uses the "shine" sprite type,
/// runs at 1.5× speed, removes self on completion.
/// </summary>
public class Shine : Entity
{
public Shine( int x, int y, TransposerScene scene )
{
PixelPosition = new PixelPoint( x, y );
_scene = scene;
_type = "shine";
_layer = Globals.DEPTH_SHINE;
AnimTimeScale = 1.5f;
PlayAnimation( "shine" );
SetAnimCompleteCallback( () => ((GameScene)_scene).RemoveShine( this ) );
}
}